Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Oops, a coderef's object is not static.
  • Loading branch information
jnthn committed Feb 1, 2013
1 parent 2cd759d commit 22b32c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/org/perl6/nqp/runtime/CodeRef.java
Expand Up @@ -16,6 +16,11 @@ public class CodeRef extends SixModelObject {
*/
public CallFrame outer;

/**
* High level code object, if any.
*/
public SixModelObject codeObject;

/**
* Sets up the code-ref data structure.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -1726,13 +1726,13 @@ public static SixModelObject takeclosure(SixModelObject code, ThreadContext tc)
}
public static SixModelObject getcodeobj(SixModelObject code, ThreadContext tc) {
if (code instanceof CodeRef)
return ((CodeRef)code).staticInfo.codeObject;
return ((CodeRef)code).codeObject;
else
throw new RuntimeException("getcodeobj can only be used with a CodeRef");
}
public static SixModelObject setcodeobj(SixModelObject code, SixModelObject obj, ThreadContext tc) {
if (code instanceof CodeRef) {
((CodeRef)code).staticInfo.codeObject = obj;
((CodeRef)code).codeObject = obj;
return code;
}
else {
Expand Down
5 changes: 0 additions & 5 deletions src/org/perl6/nqp/runtime/StaticCodeInfo.java
Expand Up @@ -35,11 +35,6 @@ public class StaticCodeInfo {
*/
public CallFrame priorInvocation;

/**
* High level code object, if any.
*/
public SixModelObject codeObject;

/**
* Maximum argument counts by argument type.
*/
Expand Down

0 comments on commit 22b32c8

Please sign in to comment.