fix #17325 linux 32bit CI; fix #17085 flaky test (#17469)

This commit is contained in:
Timothee Cour 2021-03-24 02:36:15 -07:00 • committed by GitHub
commit e94aec20da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 10 deletions

View file

@ -1075,12 +1075,13 @@ when defined(nimFixedForwardGeneric):
dst = jsonNode.copy
proc initFromJson[T: SomeInteger](dst: var T; jsonNode: JsonNode, jsonPath: var string) =
when T is uint|uint64:
when T is uint|uint64 or (not defined(js) and int.sizeof == 4):
verifyJsonKind(jsonNode, {JInt, JString}, jsonPath)
case jsonNode.kind
of JString:
dst = T(parseBiggestUInt(jsonNode.str))
let x = parseBiggestUInt(jsonNode.str)
dst = cast[T](x)
else:
verifyJsonKind(jsonNode, {JInt}, jsonPath)
dst = T(jsonNode.num)
else:
verifyJsonKind(jsonNode, {JInt}, jsonPath)