aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexandros Naskos <alex_naskos@hotmail.com>2018-05-03 04:43:07 +0300
committerAndrew Kelley <superjoe30@gmail.com>2018-05-02 21:43:07 -0400
commit131c133bb74eab2012158c8ecfaa78944db197c7 (patch)
treed02e9e5c9725ca18204d4e9658ad8069287e3c06 /src
parent02c1b9df3bcf2e0324adf02fd6c0ed56fe58c6d3 (diff)
downloadzig-131c133bb74eab2012158c8ecfaa78944db197c7.tar.gz
zig-131c133bb74eab2012158c8ecfaa78944db197c7.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/ir.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 469900bf07..47f188fdf8 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -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;