Skip to content

Commit

Permalink
Add donilcheck check before doing a nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
demoitem committed Jul 20, 2021
1 parent ae2eba2 commit 8a842be
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions m3-sys/m3front/src/exprs/QualifyExpr.m3
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,9 @@ PROCEDURE Compile (p: P) =
IF (obj_offset >= 0) THEN
INC (fieldInfo.offset, obj_offset);
ELSE
CG.Check_nil (CG.RuntimeError.BadMemoryReference);
IF Host.doNilChk THEN
CG.Check_nil (CG.RuntimeError.BadMemoryReference);
END;
Type.LoadInfo (p.holder, M3RT.OTC_dataOffset);
CG.Index_bytes (Target.Byte);
END;
Expand Down Expand Up @@ -580,7 +582,9 @@ PROCEDURE CompileLV (p: P; traced: BOOLEAN) =
IF (obj_offset >= 0) THEN
INC (field.offset, obj_offset);
ELSE
CG.Check_nil (CG.RuntimeError.BadMemoryReference);
IF Host.doNilChk THEN
CG.Check_nil (CG.RuntimeError.BadMemoryReference);
END;
Type.LoadInfo (p.holder, M3RT.OTC_dataOffset);
CG.Index_bytes (Target.Byte);
END;
Expand Down

0 comments on commit 8a842be

Please sign in to comment.