Commit 2ae61c64 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix some liveness-analysis bugs

parent b887bc87
...@@ -105,11 +105,18 @@ public: ...@@ -105,11 +105,18 @@ public:
bool visit_classdef(AST_ClassDef* node) { bool visit_classdef(AST_ClassDef* node) {
_doStore(node->name); _doStore(node->name);
for (auto e : node->bases)
e->accept(this);
for (auto e : node->decorator_list)
e->accept(this);
return true; return true;
} }
bool visit_functiondef(AST_FunctionDef* node) { bool visit_functiondef(AST_FunctionDef* node) {
for (auto* d : node->args->defaults) for (auto* d : node->decorator_list)
d->accept(this); d->accept(this);
node->args->accept(this);
_doStore(node->name); _doStore(node->name);
return true; return true;
...@@ -124,10 +131,11 @@ public: ...@@ -124,10 +131,11 @@ public:
bool visit_name(AST_Name* node) { bool visit_name(AST_Name* node) {
if (node->ctx_type == AST_TYPE::Load) if (node->ctx_type == AST_TYPE::Load)
_doLoad(node->id, node); _doLoad(node->id, node);
else if (node->ctx_type == AST_TYPE::Store || node->ctx_type == AST_TYPE::Del) else if (node->ctx_type == AST_TYPE::Store || node->ctx_type == AST_TYPE::Del
|| node->ctx_type == AST_TYPE::Param)
_doStore(node->id); _doStore(node->id);
else { else {
assert(0); ASSERT(0, "%d", node->ctx_type);
abort(); abort();
} }
return true; return true;
......
...@@ -706,6 +706,8 @@ void AST_Repr::accept(ASTVisitor* v) { ...@@ -706,6 +706,8 @@ void AST_Repr::accept(ASTVisitor* v) {
bool skip = v->visit_repr(this); bool skip = v->visit_repr(this);
if (skip) if (skip)
return; return;
value->accept(v);
} }
void* AST_Repr::accept_expr(ExprVisitor* v) { void* AST_Repr::accept_expr(ExprVisitor* v) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment