diff --git a/groth16/files/container.nim b/groth16/files/container.nim index 28e2a0d..208b853 100644 --- a/groth16/files/container.nim +++ b/groth16/files/container.nim @@ -61,8 +61,8 @@ proc readSection[T] ( expectedMagic: string , stream: Stream , user: var T , callback: SectionCallback[T] - , filt: proc(_: int): bool {.raises: [IOError, OSError].} - ) {.raises: [IOError, OSError].} = + , filt: proc(_: int): bool {.gcsafe, raises: [IOError, OSError].} + ) {.gcsafe, raises: [IOError, OSError].} = let sectId = int( stream.readUint32() ) let sectLen = int( stream.readUint64() ) @@ -78,7 +78,7 @@ proc parseContainer*[T] ( expectedMagic: string , fname: string , user: var T , callback: SectionCallback[T] - , filt: proc(_: int): bool {.raises: [IOError, OSError].} + , filt: proc(_: int): bool {.gcsafe, raises: [IOError, OSError].} ) {.raises: [IOError, OSError].} = let stream = newFileStream(fname, mode = fmRead) diff --git a/groth16/files/zkey.nim b/groth16/files/zkey.nim index 8ee4129..2da39f4 100644 --- a/groth16/files/zkey.nim +++ b/groth16/files/zkey.nim @@ -238,7 +238,7 @@ proc zkeyCallback(stream: Stream, sectId: int, sectLen: int, user: var ZKey) = of 9: parseSection9_PointsH1( stream, user, sectLen ) else: discard -proc parseZKey* (fname: string): ZKey = +proc parseZKey* (fname: string): ZKey {.gcsafe.} = var zkey : ZKey parseContainer( "zkey", 1, fname, zkey, zkeyCallback, proc (id: int): bool = id == 1 ) parseContainer( "zkey", 1, fname, zkey, zkeyCallback, proc (id: int): bool = id == 2 )