From 71f2d149bbe67b6af2e4c70cd68aabb56c63d713 Mon Sep 17 00:00:00 2001 From: Philipp Shemetov Date: Mon, 16 Dec 2024 17:59:08 +0300 Subject: [PATCH] Fix warning exception about std::sto Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IBBNQO Testing: All required pre-merge tests passed. Results are available in the ggwatcher. Signed-off-by: Philipp Shemetov --- runtime/base/json_parser.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/base/json_parser.h b/runtime/base/json_parser.h index 52c07dfe7..59a11fd53 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) -- Gitee