mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 23:05:27 +00:00
allow addressing elements of openArray[char] in VM (#22045)
allow addressing elements of openArray[char]
(cherry picked from commit a8d0dda833)
This commit is contained in:
@@ -772,6 +772,8 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||
else:
|
||||
if src.kind notin {nkEmpty..nkTripleStrLit} and idx <% src.len:
|
||||
takeAddress regs[ra], src.sons[idx]
|
||||
elif src.kind in nkStrKinds and idx <% src.strVal.len:
|
||||
regs[ra] = takeCharAddress(c, src, idx, pc)
|
||||
else:
|
||||
stackTrace(c, tos, pc, formatErrorIndexBound(idx, src.safeLen-1))
|
||||
of opcLdStrIdx:
|
||||
|
||||
Reference in New Issue
Block a user