From 540a9aea0dba98093704638366cf5d5f4781e9bf Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Wed, 10 Mar 2021 14:35:03 +0900 Subject: [PATCH] Fix bug in json float parsing found by WASM IDE's static analyzer --- modules/json.krk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/json.krk b/modules/json.krk index 18256f6..e9371a8 100644 --- a/modules/json.krk +++ b/modules/json.krk @@ -113,8 +113,8 @@ def loads(s): if peek() not in '0123456789': raise ValueError("Expected digit") while peek() in '0123456789': - value = value + multiplier * int(peek()) - multiplier = multiplier * 0.1 + value = value + mult * int(peek()) + mult = mult * 0.1 advance() if peek() in 'eE': raise NotImplementedError("Exponent values are not implemented.")