問題タブ [c-api]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c++ - lua コルーチン API と lua_close を使用するとセグメンテーション違反が発生する
私は lua スクリプト割り込みプロジェクトに取り組んでいます。std::Stack と lua コルーチンを使用してコンテキストを保存したいと考えています。しかし、stacksize を 38 以上に設定すると、lua_resume と lua_close でランダムにクラッシュします。test.lua:
main.cpp:
コンパイラ オプション:
lua_newthread の呼び出しを間違えたのではないかと思ったので、lua_newstate を呼び出す前にスタックチェックを行ったところ、正常になりました。
これで間違いを犯したかどうか、どうすれば正しくできるか知りたいですか?