Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created July 7, 2014 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnthn/eedc2eff5cbaeab83c06 to your computer and use it in GitHub Desktop.
Save jnthn/eedc2eff5cbaeab83c06 to your computer and use it in GitHub Desktop.
diff --git a/src/Perl6/Optimizer.nqp b/src/Perl6/Optimizer.nqp
index 7c099bd..fc25f78 100644
--- a/src/Perl6/Optimizer.nqp
+++ b/src/Perl6/Optimizer.nqp
@@ -474,8 +474,8 @@ my class BlockVarOptimizer {
method is_poisoned() { $!poisoned }
method is_flattenable() {
+ return 0 if $!poisoned || $!uses_bindsig;
for %!decls {
- return 0 if $_.value.scope eq 'lexical';
return 0 if $_.value.decl eq 'param';
}
1
@@ -871,7 +871,7 @@ class Perl6::Optimizer {
# If the block is immediate, we may be able to inline it.
my int $flattened := 0;
my $result := $block;
- if $block.blocktype eq 'immediate' && !$*DYNAMICALLY_COMPILED && !$vars_info.is_poisoned {
+ if $block.blocktype eq 'immediate' && !$*DYNAMICALLY_COMPILED && $vars_info.is_flattenable {
# Scan symbols for any non-interesting ones.
my @sigsyms;
for $block.symtable() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment