Skip to content

Commit

Permalink
JACOBIN-336 Corrected check for null pointer in IFNONNULL
Browse files Browse the repository at this point in the history
  • Loading branch information
platypusguy committed Aug 16, 2023
1 parent 45c9e3a commit 393114a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jvm/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -2241,7 +2241,7 @@ func runFrame(fs *list.List) error {
value := pop(f)
if value != nil { // it's not nil, but is it a null pointer?
checkForPtr := value.(*object.Object)
if checkForPtr == nil { // it really is a null pointer, so just move on
if checkForPtr == nil || checkForPtr == object.Null { // it really is a null pointer, so just move on
f.PC += 2
} else { // no, it's not nil nor a null pointer--so do the jump
jumpTo := (int16(f.Meth[f.PC+1]) * 256) + int16(f.Meth[f.PC+2])
Expand Down

0 comments on commit 393114a

Please sign in to comment.