diff --git a/runtime/base/json_parser.h b/runtime/base/json_parser.h index 52c07dfe72c13fd3ce52105719be39ba78c9d05e..59a11fd53e91539921f4ade6316a2e3626b93bd2 100644 --- a/runtime/base/json_parser.h +++ b/runtime/base/json_parser.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -133,7 +133,7 @@ private: if (isFast) { std::string strNum(current_, end_ + 1); current_ = end_; - auto d = std::stod(strNum); + auto d = PandaStringToD(ConvertToString(strNum)); if (static_cast(d) == d) { return JSTaggedValue(static_cast(d)); } @@ -162,7 +162,7 @@ private: std::string strNum(current, end_ + 1); current_ = end_; - return JSTaggedValue(std::stod(strNum)); + return JSTaggedValue(PandaStringToD(ConvertToString(strNum))); } bool ReadJsonStringRange(bool &isFastString, bool &isAscii)