Skip to content

Commit

Permalink
Let VArray out of bound access eval as VUndef
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Jul 23, 2024
1 parent 1b93b1e commit 14ec648
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hld/Eval.hx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class Eval {
switch( v.v ) {
case VArray(t, len, read, _):
var i = toInt(i);
return i < 0 || i >= len ? defVal(t) : read(i);
return i < 0 || i >= len ? { v : VUndef, t : t } : read(i);
case VBytes(len, read, _):
var i = toInt(i);
return i < 0 || i >= len ? { v : VUndef, t : HUi8 } : { v : VInt(read(i)), t : HUi8 };
Expand Down

0 comments on commit 14ec648

Please sign in to comment.