From: Carlos Maniero <carlos@maniero.me>
To: ~johnnyrichard/olang-devel@lists.sr.ht
Cc: Carlos Maniero <carlos@maniero.me>
Subject: [PATCH olang v1 1/3] fix: checker: populate vardef value scope
Date: Mon, 14 Oct 2024 12:06:20 +0000 (UTC) [thread overview]
Message-ID: <20241014120607.90304-2-carlos@maniero.me> (raw)
In-Reply-To: <20241014120607.90304-1-carlos@maniero.me>
It also include asserts on function enter to ensure the pointers are
set.
Signed-off-by: Carlos Maniero <carlos@maniero.me>
---
src/checker.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/checker.c b/src/checker.c
index 1230c3c..0acab13 100644
--- a/src/checker.c
+++ b/src/checker.c
@@ -105,6 +105,9 @@ checker_check(checker_t *checker, ast_node_t *ast)
static void
populate_scope(checker_t *checker, scope_t *scope, ast_node_t *ast)
{
+ assert(checker);
+ assert(scope);
+
switch (ast->kind) {
case AST_NODE_TRANSLATION_UNIT: {
list_item_t *item = list_head(ast->as_translation_unit.decls);
@@ -219,6 +222,8 @@ populate_scope(checker_t *checker, scope_t *scope, ast_node_t *ast)
scope_insert(scope, symbol);
ast->as_var_def.scope = scope;
+
+ populate_scope(checker, scope, ast->as_var_def.value);
return;
}
--
2.46.1
next prev parent reply other threads:[~2024-10-14 12:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 12:06 [PATCH olang v1 0/3] codege: initial implementation of pointers Carlos Maniero
2024-10-14 12:06 ` Carlos Maniero [this message]
2024-10-14 12:06 ` [PATCH olang v1 2/3] codegen: x64: generate address of (&) Carlos Maniero
2024-10-14 12:06 ` [PATCH olang v1 3/3] codegen: x64: generate dereference assignment Carlos Maniero
2024-10-14 12:07 ` [olang/patches/.build.yml] build success builds.sr.ht
2024-10-14 14:35 ` [PATCH olang v1 0/3] codege: initial implementation of pointers Johnny Richard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241014120607.90304-2-carlos@maniero.me \
--to=carlos@maniero.me \
--cc=~johnnyrichard/olang-devel@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.johnnyrichard.com/olang.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox