Skip to content

Commit

Permalink
Fix off-by-one error in primContextAt(Put)
Browse files Browse the repository at this point in the history
Fixes #162
  • Loading branch information
fniephaus committed Jan 22, 2025
1 parent 6afa3b0 commit d209eff
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ protected final AbstractSqueakObject findNextAvoidingMaterialization(final Conte
@GenerateNodeFactory
@SqueakPrimitive(indices = 210)
protected abstract static class PrimContextAtNode extends AbstractPrimitiveNode implements BinaryPrimitiveFallback {
@Specialization(guards = {"index < receiver.getStackSize()"})
@Specialization(guards = {"index <= receiver.getStackSize()"})
protected static final Object doContextObject(final ContextObject receiver, final long index,
@Bind("this") final Node node,
@Cached final ContextObjectReadNode readNode) {
Expand All @@ -289,7 +289,7 @@ protected static final Object doContextObject(final ContextObject receiver, fina
@GenerateNodeFactory
@SqueakPrimitive(indices = 211)
protected abstract static class PrimContextAtPutNode extends AbstractPrimitiveNode implements TernaryPrimitiveFallback {
@Specialization(guards = "index < receiver.getStackSize()")
@Specialization(guards = "index <= receiver.getStackSize()")
protected static final Object doContextObject(final ContextObject receiver, final long index, final Object value,
@Bind("this") final Node node,
@Cached final ContextObjectWriteNode writeNode) {
Expand Down

0 comments on commit d209eff

Please sign in to comment.