[Webkit-unassigned] [Bug 220714] [AppleWin 32bit][LLInt] LLIntData.h(104) : warning C4172: returning address of local variable or temporary: id

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 26 12:47:37 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=220714

Mark Lam <mark.lam at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark.lam at apple.com

--- Comment #3 from Mark Lam <mark.lam at apple.com> ---
Comment on attachment 417845
  --> https://bugs.webkit.org/attachment.cgi?id=417845
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210126/e1d36b10/attachment-0001.htm>


More information about the webkit-unassigned mailing list