You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ShadowStack will bring unneccessary debug location #2704
As shadow stack will insert stack increase or decrease operations without debug location, but Binaryen debug location strategy is range, that means the offset from previous expression offset to current expression offset, they all be regarded to the debug location of previous expression, here id code from WasmBinaryWriter::writeSourceMapEpilog:
the stack pointer update will be inserted before return instruction, but from debug location, it inherit from another basic block.
I checked from binaryen side, how can prevent this happened, from current solution of Source map of binaryen, it is hard to do that, and from AssemblyScript side, I think if we can add the specific debug location for the stack update expressions?
Steps to reproduce
1, compile as file:
export function test(result: boolean, value: string, key: string): void
{
let total = 0, failed = 0;
if (!result)
{ failed++;
if (value == key)
{ total += failed; }
else
{ total += 1; }
}
return;
}
Activity