From c9ef2b3dc8357a1ddbc717944b1cc21f4ae9efea Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 24 Apr 2020 19:44:55 -0700 Subject: mu.subx: append-to-block I'm just cleaning up the final call to append-list, and it's internally consistent if `block` can be an `addr`. I don't know yet if that makes sense for callers. I think I also found a bug in append-to-block: it was clobbering eax. --- apps/mu.subx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'apps/mu.subx') diff --git a/apps/mu.subx b/apps/mu.subx index 7fa1042f..d66fd0d8 100644 --- a/apps/mu.subx +++ b/apps/mu.subx @@ -5951,19 +5951,22 @@ $append-stmt-var:end: 5d/pop-to-ebp c3/return -append-to-block: # ad: (addr allocation-descriptor), block: (handle block), x: (handle stmt) +append-to-block: # ad: (addr allocation-descriptor), block: (addr block), x: (handle stmt) # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # . save registers + 50/push-eax 56/push-esi # esi = block 8b/-> *(ebp+0xc) 6/r32/esi - (append-list *(ebp+8) *(ebp+0x10) *(esi+4)) # ad, x, Block-stmts - 89/<- *(esi+4) 0/r32/eax # Block-stmts + # block->stmts = append(x, block->stmts) + 8d/copy-address *(esi+4) 0/r32/eax + (append-list *(ebp+8) *(ebp+0x10) *(ebp+0x14) *(esi+4) *(esi+8) %eax) # ad, x, x, Block-stmts, Block-stmts $append-to-block:end: # . restore registers 5e/pop-to-esi + 58/pop-to-eax # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp -- cgit 1.4.1-2-gfad0