Commit df311e7
committed
fix(zig): emit constructorSlots from stack lowering placeholder ops
The Zig compiler's stack lowering was emitting push_data("") for
constructor parameter reads instead of proper placeholder ops. This
meant emitArtifact never recorded constructorSlots in the JSON, so
the SDK couldn't splice constructor args (PubKey, Addr, etc.) into
the locking script at deployment.
Now lowerPropertyRead emits a .placeholder instruction (with the
correct param_index) when a readonly property without an initial
value is referenced — matching the TS reference compiler's behavior.
Also added placeholder handling to StackInstruction, emitStackInstruction,
and the peephole optimizer's isPush/instEql helpers.
P2PKH, Escrow, and all other stateless contracts now deploy and
call correctly. 35/36 integration tests pass.1 parent 9a1b43f commit df311e7
File tree
4 files changed
+15
-4
lines changed- compilers/zig/src
- codegen
- ir
- passes
4 files changed
+15
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
233 | 237 | | |
234 | 238 | | |
235 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
941 | | - | |
942 | | - | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
943 | 949 | | |
944 | 950 | | |
945 | 951 | | |
| |||
0 commit comments