summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-06-18 17:50:15 +0200
committerkdx <kikoodx@paranoici.org>2023-06-18 17:50:15 +0200
commit3c0b034ee902432baed7030cc65cb2443a846600 (patch)
tree19d3d11642d1d1e363d44029a2d6d17218a3ec59 /src
parent874245962e04264ab3c8a993a109f1790ddb36e2 (diff)
downloadgolem-3c0b034ee902432baed7030cc65cb2443a846600.tar.gz
local init accepts any expr
Diffstat (limited to 'src')
-rw-r--r--src/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 1445c4e..f235c54 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1069,12 +1069,13 @@ gen_localdec(Node *node)
return;
const int found = node_find(locals, node->lhs);
- printf("\tLIT %04x\n", const_expr(node->rhs));
+ gen_expr(node->rhs);
printf("\tLIT ,__stack_ptr LDA\n");
if (locals_size - found - 1)
printf("\tLIT %04x SUB\n",
locals_size - found - 1);
printf("\tSTA\n");
+ depth -= 1;
}
static void