Fixed inlining determination test (#972)
When deciding wether we should inline a scope, look up the parents until we get to a function definition scope
This commit is contained in:
committed by
Andrew Kelley
parent
02c1b9df3b
commit
131c133bb7
@@ -145,6 +145,8 @@ static bool ir_should_inline(IrExecutable *exec, Scope *scope) {
|
||||
while (scope != nullptr) {
|
||||
if (scope->id == ScopeIdCompTime)
|
||||
return true;
|
||||
if (scope->id == ScopeIdFnDef)
|
||||
break;
|
||||
scope = scope->parent;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user