Skip to content

Commit 39c9d3b

Browse files
committed
Go, Rust: Fix usage of incorrect stream in repeat: eos loops when _io is redefined
1 parent b3763d4 commit 39c9d3b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

shared/src/main/scala/io/kaitai/struct/languages/GoCompiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ class GoCompiler(typeProvider: ClassTypeProvider, config: RuntimeConfig)
305305
out.inc
306306

307307
val eofVar = translator.allocateLocalVar()
308-
out.puts(s"${translator.localVarName(eofVar)}, err := this._io.EOF()")
308+
out.puts(s"${translator.localVarName(eofVar)}, err := $io.EOF()")
309309
translator.outAddErrCheck()
310310
out.puts(s"if ${translator.localVarName(eofVar)} {")
311311
out.inc

shared/src/main/scala/io/kaitai/struct/languages/RustCompiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class RustCompiler(typeProvider: ClassTypeProvider, config: RuntimeConfig)
283283
out.puts("{")
284284
out.inc
285285
out.puts(s"let mut _i = 0;")
286-
out.puts(s"while !_io.is_eof() {")
286+
out.puts(s"while !$io.is_eof() {")
287287
out.inc
288288
}
289289

0 commit comments

Comments
 (0)