diff options
author | Kartik Agaram <vc@akkartik.com> | 2021-01-15 21:36:25 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2021-01-16 09:06:01 -0800 |
commit | a8dd0d40942485a65995ac59c3f1bc4a6727e236 (patch) | |
tree | bbf447b6a5c44799dcbb6f78e698f9371d2172dc /313index-bounds-check.subx | |
parent | 0d246473c5270a0f13a2706a1f0204d375f62d30 (diff) | |
download | mu-a8dd0d40942485a65995ac59c3f1bc4a6727e236.tar.gz |
7525
Bring back runtime support for bounds-checking arrays. Again, the error messages kinda suck, because I can't yet print integers. But something is better than nothing.
Diffstat (limited to '313index-bounds-check.subx')
-rw-r--r-- | 313index-bounds-check.subx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/313index-bounds-check.subx b/313index-bounds-check.subx index 1349e3d4..615935b3 100644 --- a/313index-bounds-check.subx +++ b/313index-bounds-check.subx @@ -37,6 +37,7 @@ __check-mu-array-bounds: # index: int, elem-size: int, arr-size: int, function- # exit(1) bb/copy-to-ebx 1/imm32 e8/call syscall_exit/disp32 + # never gets here $__check-mu-array-bounds:end: # . restore registers 5a/pop-to-edx @@ -58,6 +59,7 @@ __check-mu-array-bounds:overflow: # exit(1) bb/copy-to-ebx 1/imm32 e8/call syscall_exit/disp32 + # never gets here # potential alternative |