[ オリジナルレポート ]

BugID: #08242

カテゴリ 重要度 ステータス 解決状況 登録日時 最終更新
プラグイン解決済み修正済み2022-03-05 00:352022-04-01 14:14
 
テスターBletch担当者cuavasソース
バージョン0.241発生バージョン修正バージョン0.242
修正コミット dd1e5b1プルリク #9419
フラグ
セット
セット詳細
 
概 要ClangビルドでLUAエラー。
詳 細For me, the following LUA code seems to fail on self-made Clang/Visual Studio builds:

local file = emu.file(manager.machine.options.entries.cheatpath:value(), 1);
file:open("cheat.blah");
local blah = file:read(file:size());
manager.machine:popmessage("blah: " .. tostring(blah));

The error seems to be:

[LUA ERROR] in execute_function: stack index 2, expected userdata, received number: value is not a valid userdata (bad argument into 'void) [T = sol::buffer *](void) [T = emu_file &], void) [T = sol::buffer *])')

The problem seems to be that file:read() fails, because it fails to convert the return value from file:size() to a number.

At first, I assumed this was a Sol 3 regression, but I later discovered that this does not seem to happen in any normal MinGW builds. I strongly suspect that this may be some sort of a compiler bug (perhaps with Clang or my older version of Clang), but I'd like to report it to see if anybody sees this problem elsewhere.
再現手順1. Paste the above snippet into `dummy.startplugin()` in plugins/dummy/init.lua
2. Ensure that a text file called "cheat.blah" is in your cheat path
3. 'mame anydriver -plugin dummy'
追加情報 
 
添付ファイル