Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement embeddedblock, fix crash on 10th variable in a sub
  • Loading branch information
sorear committed Oct 3, 2011
1 parent 04630ce commit aaeae45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Kernel.cs
Expand Up @@ -1060,6 +1060,11 @@ public abstract class LIVarish : LexInfo {
public override int SigIndex() { return index; }
public override void BindFields() {
index = owner.num_lex_slots++;
if (owner.protopad != null) {
int osz = owner.protopad.lexn == null ? 0 : owner.protopad.lexn.Length;
if (owner.num_lex_slots > 10 + osz)
Array.Resize(ref owner.protopad.lexn, owner.num_lex_slots * 2 - 10);
}
}

public override object Get(Frame f) {
Expand Down
6 changes: 6 additions & 0 deletions src/niecza
Expand Up @@ -425,6 +425,12 @@ method method_def ($/) {
make ::Op::Lexical.new(|node($/), name => $*CURLEX<!sub>.outervar);
}

method embeddedblock($/) {
$*CURLEX<!sub>.finish($<statementlist>.ast);
$*CURLEX<!sub>.set_signature(Sig.simple());
make $*CURLEX<!sub>;
}

method blockoid($/) {
# XXX horrible cheat, but my data structures aren't up to the task of
# $::UNIT being a class body &c.
Expand Down

0 comments on commit aaeae45

Please sign in to comment.