mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 07:46:08 +02:00
* WebAssembly: generate the final bashB opcode of a function via the
end_function instruction, instead of adding it magically in the object writer. This makes the WebAssembly debug line info more accurate, covering the end_function instruction as well.
This commit is contained in:
parent
d81170ab23
commit
99943610cb
@ -1322,14 +1322,13 @@ implementation
|
|||||||
|
|
||||||
encoded_locals:=tdynamicarray.Create(64);
|
encoded_locals:=tdynamicarray.Create(64);
|
||||||
WriteFunctionLocals(encoded_locals,ObjSymExtraData);
|
WriteFunctionLocals(encoded_locals,ObjSymExtraData);
|
||||||
codelen:=encoded_locals.size+codeexprlen+1;
|
codelen:=encoded_locals.size+codeexprlen;
|
||||||
WriteUleb(dest,codelen);
|
WriteUleb(dest,codelen);
|
||||||
encoded_locals.seek(0);
|
encoded_locals.seek(0);
|
||||||
CopyDynamicArray(encoded_locals,dest,encoded_locals.size);
|
CopyDynamicArray(encoded_locals,dest,encoded_locals.size);
|
||||||
ObjSection.FileSectionOfs:=dest.size-objsym.offset;
|
ObjSection.FileSectionOfs:=dest.size-objsym.offset;
|
||||||
ObjSection.EncodedLocalsSize:=encoded_locals.size;
|
ObjSection.EncodedLocalsSize:=encoded_locals.size;
|
||||||
CopyDynamicArray(ObjSection.Data,dest,codeexprlen);
|
CopyDynamicArray(ObjSection.Data,dest,codeexprlen);
|
||||||
WriteByte(dest,$0B);
|
|
||||||
encoded_locals.Free;
|
encoded_locals.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -2236,6 +2236,7 @@ uses
|
|||||||
a_end_if,
|
a_end_if,
|
||||||
a_end_loop,
|
a_end_loop,
|
||||||
a_end_try,
|
a_end_try,
|
||||||
|
a_end_function,
|
||||||
a_catch_all,
|
a_catch_all,
|
||||||
a_ref_is_null:
|
a_ref_is_null:
|
||||||
result:=1;
|
result:=1;
|
||||||
@ -2350,8 +2351,6 @@ uses
|
|||||||
internalerror(2021092011);
|
internalerror(2021092011);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
a_end_function:
|
|
||||||
result:=0;
|
|
||||||
a_block,
|
a_block,
|
||||||
a_loop,
|
a_loop,
|
||||||
a_if,
|
a_if,
|
||||||
@ -2993,7 +2992,8 @@ uses
|
|||||||
a_end_block,
|
a_end_block,
|
||||||
a_end_if,
|
a_end_if,
|
||||||
a_end_loop,
|
a_end_loop,
|
||||||
a_end_try:
|
a_end_try,
|
||||||
|
a_end_function:
|
||||||
WriteByte($0B);
|
WriteByte($0B);
|
||||||
a_catch_all:
|
a_catch_all:
|
||||||
WriteByte($19);
|
WriteByte($19);
|
||||||
@ -3132,8 +3132,6 @@ uses
|
|||||||
internalerror(2021092011);
|
internalerror(2021092011);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
a_end_function:
|
|
||||||
;
|
|
||||||
a_block,
|
a_block,
|
||||||
a_loop,
|
a_loop,
|
||||||
a_if,
|
a_if,
|
||||||
|
Loading…
Reference in New Issue
Block a user