You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I get this error message using both Nim v1.6 and v2 (I also got more smaller errors but I fixed them fairly easy, mostly syntax errors or arithmetics on variables with different types):
> nim c -d:debug -r main.nim
Hint: used config file '/home/x/.choosenim/toolchains/nim-1.6.20/config/nim.cfg' [Conf]
Hint: used config file '/home/x/.choosenim/toolchains/nim-1.6.20/config/config.nims' [Conf]
Hint: gc: refc; opt: none (DEBUG BUILD, `-d:release` generates faster code)
9935 lines; 0.015s; 10.68MiB peakmem; proj: /home/x/hobby/nim/kaitai/main.nim; out: /home/x/hobby/nim/kaitai/main [SuccessX]
Hint: /home/x/hobby/nim/kaitai/main [Exec]
/home/x/hobby/nim/kaitai/main.nim(541) main
/home/x/hobby/nim/kaitai/main.nim(538) main
/home/x/hobby/nim/kaitai/main.nim(172) fromFile
/home/x/hobby/nim/kaitai/main.nim(152) read
/home/x/hobby/nim/kaitai/main.nim(453) read
/home/x/hobby/nim/kaitai/main.nim(267) read
/home/x/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim(54) sysFatal
Error: unhandled exception: value out of range [RangeDefect]
Caused by this generated Nim code:
procread*(_: typedesc[Nvs_EntryStateBitmapT], io: KaitaiStream, root: KaitaiStruct, parent: Nvs_PageT): Nvs_EntryStateBitmapT =templatethis: untyped=result
this =new(Nvs_EntryStateBitmapT)
let root =if root ==nil: cast[Nvs](this) else: cast[Nvs](root)
this.io = io
this.root = root
this.parent = parent
for i in0..<int(((4*32) -2)):
let it =Nvs_EntryState(this.io.readBitsIntLe(2)) # <---- crashes here
this.entry.add(it)
let unnamed1Expr = this.io.readBitsIntLe(4)
this.unnamed1 = unnamed1Expr
The source .ksy file works with ksv visualizer. I compiled the Nim code with https://ide.kaitai.io/# website.
Hi, I get this error message using both Nim v1.6 and v2 (I also got more smaller errors but I fixed them fairly easy, mostly syntax errors or arithmetics on variables with different types):
Caused by this generated Nim code:
The source
.ksy
file works withksv
visualizer. I compiled the Nim code with https://ide.kaitai.io/# website.Files to replicate this in zip below:
kaitai_nim_doesnt_work.zip
The text was updated successfully, but these errors were encountered: