eas assembles broken contracts when the body is split in multiple includes
I am trying to compose a contract as follows:
%push(body_end - body_begin)
dup1
%push(body_begin)
push1 0x00
codecopy
push1 0x00
return
body_begin:
%include("A.eas")
%include("B.eas")
...
body_end:
Unfortunately the assembly is broken, as eas generates illegal jumps in the body. If I lump all the includes together and do a single file, everything works fine. So this is a bug in the assembly.
Hey Vyzo, thank you very much for your report. Your problem is mainly because the functionality you are looking for is given by the built-in %import, which inserts the code as if it was typed in the position where the built-in was called.
In the case of using %include, the new code is considered in a completely independent scope, and the labels start counting from zero again, hence your problem.
You can check the documentation for a more detailed explanation.
Thanks again!
P.S: @lightclient I think you can close this issue