From 1b93b1e835e965c17b84b29e44130b0bda525e8f Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Tue, 23 Jul 2024 09:31:00 +0200 Subject: [PATCH] Allow array access byte in VBytes (i.e. haxe.io.Bytes) --- hld/Eval.hx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hld/Eval.hx b/hld/Eval.hx index 305c56e..d3fcbad 100644 --- a/hld/Eval.hx +++ b/hld/Eval.hx @@ -220,6 +220,9 @@ class Eval { case VArray(t, len, read, _): var i = toInt(i); return i < 0 || i >= len ? defVal(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 }; default: } throw "Can't access " + valueStr(v) + "[" + valueStr(i) + "]";