From 7ef781e87d520d271c049c18aa84f68f5699ae9c Mon Sep 17 00:00:00 2001 From: varvara Date: Tue, 10 Jun 2025 16:22:12 +0300 Subject: [PATCH] fix invalid number value Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/ICEFYK?from=project-issue Signed-off-by: varvara --- ets2panda/lexer/token/number.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ets2panda/lexer/token/number.cpp b/ets2panda/lexer/token/number.cpp index 04270a6328..51de994851 100644 --- a/ets2panda/lexer/token/number.cpp +++ b/ets2panda/lexer/token/number.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 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 @@ -46,5 +46,8 @@ Number::Number(util::StringView str, NumberFlags flags) noexcept : str_(str), fl flags_ |= NumberFlags::ERROR; } } + if (res == Lexer::ConversionResult::OUT_OF_RANGE) { + num_ = 0; + } } } // namespace ark::es2panda::lexer -- Gitee