Skip to content

Commit

Permalink
Allow array access byte in hl.Bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Jul 23, 2024
1 parent 14ec648 commit f8fe128
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hld/Eval.hx
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ class Eval {
case VBytes(len, read, _):
var i = toInt(i);
return i < 0 || i >= len ? { v : VUndef, t : HUi8 } : { v : VInt(read(i)), t : HUi8 };
case VString(_, p) if( v.t.match(HBytes) ):
var i = toInt(i);
return i < 0 ? { v : VUndef, t : HUi8 } : { v : VInt(readByte(p.offset(i))), t : HUi8 };
default:
}
throw "Can't access " + valueStr(v) + "[" + valueStr(i) + "]";
Expand Down

0 comments on commit f8fe128

Please sign in to comment.