RESOLVED FIXED 220714
[AppleWin 32bit][LLInt] LLIntData.h(104) : warning C4172: returning address of local variable or temporary: id
https://bugs.webkit.org/show_bug.cgi?id=220714
Summary [AppleWin 32bit][LLInt] LLIntData.h(104) : warning C4172: returning address o...
Fujii Hironori
Reported 2021-01-18 13:30:12 PST
LowLevelInterpreterLib.dir\llint\LowLevelInterpreter.cpp.obj /FdSource\JavaScriptCore\CMakeFiles\LowLevelInterpreterLib.dir\ /FS -c ..\..\Source\JavaScriptCore\llint\LowLevelInterpreter.cpp C:\home\webkit\gb\Source\JavaScriptCore\llint\LLIntData.h(104) : error C2220: the following warning is treated as an error C:\home\webkit\gb\Source\JavaScriptCore\llint\LLIntData.h(104) : warning C4172: returning address of local variable or temporary: id
Attachments
WIP patch (1.09 KB, patch)
2021-01-18 13:33 PST, Fujii Hironori
no flags
Patch (7.75 KB, patch)
2021-02-02 15:25 PST, Yusuke Suzuki
no flags
Fujii Hironori
Comment 1 2021-01-18 13:33:36 PST
Created attachment 417845 [details] WIP patch
Radar WebKit Bug Importer
Comment 2 2021-01-25 13:31:14 PST
Mark Lam
Comment 3 2021-01-26 12:47:37 PST
Comment on attachment 417845 [details] WIP patch View in context: https://bugs.webkit.org/attachment.cgi?id=417845&action=review > Source/JavaScriptCore/llint/LLIntData.h:109 > +#if ENABLE(COMPUTED_GOTO_OPCODES) > inline const Opcode& getOpcode(OpcodeID id) > { > -#if ENABLE(COMPUTED_GOTO_OPCODES) > return g_opcodeMap[id]; > +} > #else > - return static_cast<Opcode>(id); > -#endif > +inline const Opcode getOpcode(OpcodeID id) I think it's a bad pattern to have the same function return 2 different return types. This made me wonder who is relying on the address of Opcode as a return value, and it looks like it's only the JIT functions (please double check this to confirm). Can you try making getOpcode() consistently returning Opcode, and add a new getOpcodeAddress() function guarded by #if ENABLE(JIT) that returns Opcode* and update the relevant clients to use it instead? See if that works better.
Yusuke Suzuki
Comment 4 2021-02-02 15:25:14 PST
Mark Lam
Comment 5 2021-02-02 15:32:18 PST
Comment on attachment 419073 [details] Patch r=me
EWS
Comment 6 2021-02-03 10:41:01 PST
Committed r272330: <https://trac.webkit.org/changeset/272330> All reviewed patches have been landed. Closing bug and clearing flags on attachment 419073 [details].
Note You need to log in before you can comment on or make changes to this bug.