From 696c911665eda4265e977aee5a15e88d7866c701 Mon Sep 17 00:00:00 2001 From: Ilya Trubachev Date: Mon, 14 Mar 2022 15:40:04 +0300 Subject: [PATCH] misprints fix Signed-off-by: Ilya Trubachev --- README.md | 4 ++-- assembler/meta.cpp | 2 +- cmake/ClangTidy.cmake | 2 +- cmake/Definitions.cmake | 4 ++-- cmake/PandaCmakeFunctions.cmake | 6 +++--- docs/assembly_format.md | 8 ++++---- docs/bc_verification/absint_checks.md | 2 +- docs/design-of-interpreter.md | 2 +- docs/file_format.md | 6 +++--- docs/rationale-for-bytecode.md | 4 ++-- dprof/daemon/main.cpp | 2 +- libpandabase/README.md | 2 +- libpandabase/os/native_stack.cpp | 2 +- libpandabase/utils/logger.h | 2 +- .../interpreter_to_compiled_code_bridge_aarch64.S | 2 +- .../interpreter_to_compiled_code_bridge_amd64.S | 2 +- .../arm/interpreter_to_compiled_code_bridge_armhf.S | 2 +- runtime/include/class_linker.h | 2 +- runtime/include/managed_thread.h | 2 +- runtime/include/mtmanaged_thread.h | 2 +- runtime/include/tooling/debug_interface.h | 2 +- runtime/mem/gc/gc.h | 2 +- runtime/mem/region_space.h | 2 +- runtime/options.yaml | 2 +- runtime/tests/string_test.cpp | 12 ++++++------ runtime/thread.cpp | 2 +- templates/common.rb | 6 +++--- tests/cts-generator/cts-template/call.range.yaml | 2 +- tests/cts-generator/cts-template/call.short.yaml | 4 ++-- .../cts-template/call.virt.negative.yaml | 4 ++-- .../cts-template/call.virt.range.negative.yaml | 4 ++-- tests/cts-generator/cts-template/call.yaml | 4 ++-- tests/cts-generator/cts-template/lenarr.yaml | 4 ++-- tests/verifier-tests/issue_1981.pa | 2 +- verification/debug/allowlist/allowlist.cpp | 4 ++-- verification/type/tests/type_system_test.cpp | 2 +- 36 files changed, 59 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 65aabbc94a..492f599696 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ As a common module of ARK runtime, Runtime Core consists of some basic language-irrelevant runtime libraries, including ARK File, Tooling, and ARK Base. ARK File provides bytecodes and information required for executing bytecodes. Tooling supports Debugger. ARK Base is responsible for implementing platform related utilities. -For more infomation, see: [ARK Runtime Subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/ARK-Runtime-Subsystem.md). +For more information, see: [ARK Runtime Subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/ARK-Runtime-Subsystem.md). ## Directory Structure @@ -141,7 +141,7 @@ Input file: ARK bytecodes in binary format Output file: ARK bytecodes in text format -For more infomation, please see: [ARK Runtime Usage Guide](https://gitee.com/openharmony/ark_js_runtime/blob/master/docs/ARK-Runtime-Usage-Guide.md). +For more information, please see: [ARK Runtime Usage Guide](https://gitee.com/openharmony/ark_js_runtime/blob/master/docs/ARK-Runtime-Usage-Guide.md). ## Repositories Involved diff --git a/assembler/meta.cpp b/assembler/meta.cpp index eec52ef868..361052f6ca 100644 --- a/assembler/meta.cpp +++ b/assembler/meta.cpp @@ -29,7 +29,7 @@ std::optional Metadata::ValidateSize(std::string_view value) co constexpr size_t SIZE = 10; if (!std::all_of(value.cbegin(), value.cend(), ::isdigit)) { - return Error("Unsigned interger value expected", Error::Type::INVALID_VALUE); + return Error("Unsigned integer value expected", Error::Type::INVALID_VALUE); } strtoul(value.data(), nullptr, SIZE); diff --git a/cmake/ClangTidy.cmake b/cmake/ClangTidy.cmake index 7a1189a394..67730256ea 100644 --- a/cmake/ClangTidy.cmake +++ b/cmake/ClangTidy.cmake @@ -134,7 +134,7 @@ function(panda_add_to_clang_tidy) "-hicpp-member-init" # alias for cppcoreguidelines-pro-type-member-init "-hicpp-move-const-arg" # alias for performance-move-const-arg # explicitly disabled checks - "-bugprone-macro-parentheses" # disabled because it is hard to write macroses with types with it + "-bugprone-macro-parentheses" # disabled because it is hard to write macros with types with it "-llvm-header-guard" # disabled because of incorrect root prefix "-llvm-include-order" # disabled because conflicts with the clang-format "-readability-identifier-naming" # disabled because we will use little-hump-style diff --git a/cmake/Definitions.cmake b/cmake/Definitions.cmake index 3aabf2b26f..68a91fbd61 100644 --- a/cmake/Definitions.cmake +++ b/cmake/Definitions.cmake @@ -86,13 +86,13 @@ endif() # Clang 8.0.0 doesn't support all necessary options -ffixed-. Gcc 7.5.0 freezes # when compiling release interpreter. # -# Also calling conventions of funtions that use global register variables are different: +# Also calling conventions of functions that use global register variables are different: # clang stores and restores registers that are used for global variables in the prolog # and epilog of such functions and gcc doesn't do it. So it's necessary to inline all # function that refers to global register variables to interpreter loop. # For this reason we disable global register variables usage for clang debug builds as -# ALWAYS_INLINE macro expands to nothing in this mode and we cannot garantee that all +# ALWAYS_INLINE macro expands to nothing in this mode and we cannot guarantee that all # necessary function will be inlined. # if(PANDA_TARGET_ARM64 AND ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" diff --git a/cmake/PandaCmakeFunctions.cmake b/cmake/PandaCmakeFunctions.cmake index 2c0eaed66a..ce6e6e884f 100644 --- a/cmake/PandaCmakeFunctions.cmake +++ b/cmake/PandaCmakeFunctions.cmake @@ -13,7 +13,7 @@ # 32-bits pointers optimization in Panda for objects => addresses usage low 4GB # We need use linker scripts for section replacement above 4GB -# Note: AdressSanitizer reserves (mmap) addresses for its own needs, +# Note: AddressSanitizer reserves (mmap) addresses for its own needs, # so we have difference start addresses for asan and default buildings function(panda_add_executable target) # When using rapidcheck we should use linker scripts with @@ -38,7 +38,7 @@ function(panda_add_executable target) endif() endif() # We need use specific options for AMD64 building with Clang compiler - # because it is neccessary for placement of sections above 4GB + # because it is necessary for placement of sections above 4GB if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND PANDA_TARGET_AMD64) set(LINKER_SCRIPT_ARG "${LINKER_SCRIPT_ARG} -pie") # -mcmodel=large with clang and asan on x64 leads to bugs in rapidcheck with high-mem mappings @@ -53,7 +53,7 @@ function(panda_add_executable target) endfunction() # This function need for non-SHARED libraries -# It is neccessary for 32-bits pointers via amd64 building with Clang compiler +# It is necessary for 32-bits pointers via amd64 building with Clang compiler function(panda_set_lib_32bit_property target) if(PANDA_USE_32_BIT_POINTER AND PANDA_TARGET_AMD64 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set_property(TARGET ${target} PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/docs/assembly_format.md b/docs/assembly_format.md index 9b1f3a2d32..eade511ed9 100644 --- a/docs/assembly_format.md +++ b/docs/assembly_format.md @@ -10,7 +10,7 @@ Panda as a platform is multilingual and flexible by design: * Panda Assembly should not "favor" by any means any existing programming language that is (or intended to be) supported by the platform. Instead, Panda Assembly can be thought as a separate close-to-byte-code language with a minimal feature set. All language-specific "traits" that should be supported to generate valid executable binaries with respect to the higher-level semantics should be implemented via metadata annotations (see below). * Panda Assembly should not focus on a certain programming paradigm. For example, concepts such as "class", "object", and "method" should not be enforced at the assembly language level because a language that does not implement classic OOP might be supported. -* When Panda assembler generates a binary excutable file, it is not expected to check for language semantics. This responsibility is delegated to "source to binaries" compilers and runtime. +* When Panda assembler generates a binary executable file, it is not expected to check for language semantics. This responsibility is delegated to "source to binaries" compilers and runtime. * Panda assembler should not impose any limitations on the quantity and internal structure of source code files written in Panda Assembly language. It should process as many input source code files as the developer specifies. * Panda assembler should not follow any implicit conventions about the name of the entry point. @@ -356,7 +356,7 @@ more precise verification of control flows in bytecode verifier. ``` They are identical to .catch and .catchall except that the end label of the -exception handler needs to be specified. An end label is the label that immediatly follows the last instruction of the +exception handler needs to be specified. An end label is the label that immediately follows the last instruction of the exception handler. ## Pseudo-BNF @@ -364,8 +364,8 @@ exception handler. Instruction flow is omitted for simplicity: ``` -# Literals are represnted in double-quotes as "literal value". -# Free-form descriptions are represneted as "" +# Literals are represented in double-quotes as "literal value". +# Free-form descriptions are represented as "" # Empty symbol is represented as E. defs := defs def | E diff --git a/docs/bc_verification/absint_checks.md b/docs/bc_verification/absint_checks.md index 730fdf95cd..3cf24b8e71 100644 --- a/docs/bc_verification/absint_checks.md +++ b/docs/bc_verification/absint_checks.md @@ -16,7 +16,7 @@ Or access to wrong fields of object. ### Checks of subtyping -This type of checks ensure compatibily of objects in arguments to instructions and actual parameters to methos. +This type of checks ensure compatibility of objects in arguments to instructions and actual parameters to methods. The checks eliminate calls of methods with incorrect this, wrong access to arrays, etc. diff --git a/docs/design-of-interpreter.md b/docs/design-of-interpreter.md index ebfbb8a3e9..4e562c0245 100644 --- a/docs/design-of-interpreter.md +++ b/docs/design-of-interpreter.md @@ -166,7 +166,7 @@ Please find the reference implementation [here](../runtime/interpreter). 1. Although tagged virtual registers occupy more memory (especially on 64-bit architectures), redundant memory consumption is cheaper than ongoing runtime penalties on garbage collector - trying to distiguish between objects from non-objects on an "imprecise" stack. + trying to distinguish between objects from non-objects on an "imprecise" stack. 1. Where does 128 come from? It is `128 = 64 + 64`. The first 64 is either `sizeof(long int)` or `sizeof(double)` or `sizeof(void *)` on a 64-bit architecture (i.e. theoretical maximum size of the payload we are required to store in a virtual register). The second 64 is for tag diff --git a/docs/file_format.md b/docs/file_format.md index 6c78770d45..f7a994a061 100644 --- a/docs/file_format.md +++ b/docs/file_format.md @@ -21,7 +21,7 @@ for addressing fields, methods, classes, etc. The format uses [TaggedValue](#taggedvalue), which stores only information we have, avoiding 0 offsets for absent information and saving more space. -However, to achive more compactness, 16-bit indexes are used to refer classes, methods and fields in +However, to achieve more compactness, 16-bit indexes are used to refer classes, methods and fields in the bytecode and some metadata. The file can contain multiple indexes, each one which covers part of the file and is described by [RegionHeader](#regionheader). @@ -64,7 +64,7 @@ structures should be located relatively to each other. The binary file format supports future changes via version number. The version field in the header is 4 bytes long and is encoded as a byte array to -avoid misinterpretation on platforms with different endianess. +avoid misinterpretation on platforms with different endianness. Any tool which supports format version `N` must support format version `N - 1` too. @@ -239,7 +239,7 @@ Constraint: Size of header must be > 16 bytes. [FieldType](#fieldType) uses this ### RegionHeader -To address file structures using 16-bit indexes file is splitted into regions. Each region has class, method, field and proto indexes and is described by `RegionHeader` structure. +To address file structures using 16-bit indexes file is split into regions. Each region has class, method, field and proto indexes and is described by `RegionHeader` structure. Alignment: 4 bytes diff --git a/docs/rationale-for-bytecode.md b/docs/rationale-for-bytecode.md index 99722f83ba..e06b800429 100644 --- a/docs/rationale-for-bytecode.md +++ b/docs/rationale-for-bytecode.md @@ -165,8 +165,8 @@ instruction lacks a wide-range form, we can prepare operands for it with moves t needed forms. In this way, we save opcode space without compromising encoding size (on average). With such approach, we can carefully introduce various "overloads" for instruction when it could -be beneficial. For example, we have three types of instructions for integer-sized arithmetics -(acc-reg-reg, acc-reg, acc-imm) and integer-based jumps, but not for floating-point arithmetics +be beneficial. For example, we have three types of instructions for integer-sized arithmetic +(acc-reg-reg, acc-reg, acc-imm) and integer-based jumps, but not for floating-point arithmetic (which is rare) and which is supposed to have only acc-reg form. Another good choice for overloads are calls (different number of operands) and calls are the most popular instructions in applications (thus we again save encoding space). diff --git a/dprof/daemon/main.cpp b/dprof/daemon/main.cpp index ab101afeca..e0d0d301cb 100644 --- a/dprof/daemon/main.cpp +++ b/dprof/daemon/main.cpp @@ -216,7 +216,7 @@ static void SetupSignals() }; PLOG_IF(::memset_s(&sa, sizeof(sa), 0, sizeof(sa)) != EOK, FATAL, DPROF) << "memset_s failed"; sa.sa_handler = SignalHandler; // NOLINT(cppcoreguidelines-pro-type-union-access) - PLOG_IF(::sigemptyset(&sa.sa_mask) == -1, FATAL, DPROF) << "sigemptyset() faild"; + PLOG_IF(::sigemptyset(&sa.sa_mask) == -1, FATAL, DPROF) << "sigemptyset() failed"; PLOG_IF(::sigaction(SIGINT, &sa, nullptr) == -1, FATAL, DPROF) << "sigaction(SIGINT) failed"; PLOG_IF(::sigaction(SIGHUP, &sa, nullptr) == -1, FATAL, DPROF) << "sigaction(SIGHUP) failed"; diff --git a/libpandabase/README.md b/libpandabase/README.md index e796598888..7a61d72fb2 100644 --- a/libpandabase/README.md +++ b/libpandabase/README.md @@ -37,7 +37,7 @@ Constructor can accept: There is description for them: - Argument name, is a name, which will appear in a command line. - Default value is a value argument will have regardless was it parsed or not. -- Argument description will be used to form a help messsage. +- Argument description will be used to form a help message. - Delimiter is a character or string that separates the different value if the single argument list. - Min value is the number that the integer argument cannot be less than. - Max value is the number that the integer argument cannot be greater than. diff --git a/libpandabase/os/native_stack.cpp b/libpandabase/os/native_stack.cpp index 8e49103306..21db883579 100644 --- a/libpandabase/os/native_stack.cpp +++ b/libpandabase/os/native_stack.cpp @@ -50,7 +50,7 @@ bool WriterOsFile([[maybe_unused]] const void *buffer, [[maybe_unused]] size_t c std::string ChangeJaveStackFormat([[maybe_unused]] const char *descriptor) { - return "unknow"; + return "unknown"; } #endif // PANDA_TARGET_UNIX diff --git a/libpandabase/utils/logger.h b/libpandabase/utils/logger.h index d22baae45c..c32991cf50 100644 --- a/libpandabase/utils/logger.h +++ b/libpandabase/utils/logger.h @@ -404,7 +404,7 @@ private: MERGE_WORDS(log_once_helper, __LINE__).IsFirstCall() && LOG(level, component) // Explicit namespace is specified to allow using the logger out of panda namespace. -// For exmaple, in the main function. +// For example, in the main function. // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define _LOG(level, component, p) \ panda::Logger::IsLoggingOnOrAbort(panda::Logger::Level::level, panda::Logger::Component::component) && \ diff --git a/runtime/bridge/arch/aarch64/interpreter_to_compiled_code_bridge_aarch64.S b/runtime/bridge/arch/aarch64/interpreter_to_compiled_code_bridge_aarch64.S index da6298daab..7b017a8dd1 100644 --- a/runtime/bridge/arch/aarch64/interpreter_to_compiled_code_bridge_aarch64.S +++ b/runtime/bridge/arch/aarch64/interpreter_to_compiled_code_bridge_aarch64.S @@ -37,7 +37,7 @@ // The macro works with the stack prepared by 'PrepareArgStack' procedure // It takes a pair (argument, type tag) and stores to the corresponding stack space // depends on its type. -// After the arg gets storeg the macro advances the correponding pointer +// After the arg gets storeg the macro advances the corresponding pointer // The macro assumes x9 contains base address for gpr and fpr args .macro PUSH_ARG arg_reg, tag_reg, gpr_ptr, fpr_ptr, stack_ptr, tmp_reg, next_label sub w2, w2, #SHORTY_FIRST_FLOAT diff --git a/runtime/bridge/arch/amd64/interpreter_to_compiled_code_bridge_amd64.S b/runtime/bridge/arch/amd64/interpreter_to_compiled_code_bridge_amd64.S index 0090d82e86..6bf7c12cea 100644 --- a/runtime/bridge/arch/amd64/interpreter_to_compiled_code_bridge_amd64.S +++ b/runtime/bridge/arch/amd64/interpreter_to_compiled_code_bridge_amd64.S @@ -99,7 +99,7 @@ // The macro works with the stack prepared by 'PrepareArgStack' macro // It takes an argument in arg_reg and stores it to the corresponding stack space // depends on its type. -// After the arg gets stored the macro advances the correponding pointer +// After the arg gets stored the macro advances the corresponding pointer // The macro assumes %r8 contains base address for gpr and fpr args .macro PUSH_ARG arg_reg, tag_reg, gpr_ptr, fpr_ptr, stack_ptr, tmp_reg, next_label subl $SHORTY_FIRST_FLOAT, %r11d diff --git a/runtime/bridge/arch/arm/interpreter_to_compiled_code_bridge_armhf.S b/runtime/bridge/arch/arm/interpreter_to_compiled_code_bridge_armhf.S index 1d46a19782..64458cd723 100644 --- a/runtime/bridge/arch/arm/interpreter_to_compiled_code_bridge_armhf.S +++ b/runtime/bridge/arch/arm/interpreter_to_compiled_code_bridge_armhf.S @@ -67,7 +67,7 @@ // The macro works with the stack prepared by 'PrepareArgStack' procedure // It takes an argument in arg_reg and stores it to the corresponding stack space // depends on its type. -// After the arg gets storeg the macro advances the correponding pointer +// After the arg gets storeg the macro advances the corresponding pointer // The macro assumes x9 contains base address for gpr and fpr args .macro PUSH_ARG arg_ptr, gpr_ptr, fpr_ptr, stack_ptr, tmp1, tmp2, next_label diff --git a/runtime/include/class_linker.h b/runtime/include/class_linker.h index 3233f99072..c740c85068 100644 --- a/runtime/include/class_linker.h +++ b/runtime/include/class_linker.h @@ -170,7 +170,7 @@ public: if (founded) { os << "|Parent class loader: #" << parent_index << "\n"; } else { - os << "|Parent class loader: unknow\n"; + os << "|Parent class loader: unknown\n"; } } else { os << "|Parent class loader: empty\n"; diff --git a/runtime/include/managed_thread.h b/runtime/include/managed_thread.h index 1f547bcfd6..9d11709d90 100644 --- a/runtime/include/managed_thread.h +++ b/runtime/include/managed_thread.h @@ -365,7 +365,7 @@ public: // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) if (stor_32_.fts_.as_atomic.compare_exchange_weak(old_fts.as_nonvolatile_int, new_fts.as_nonvolatile_int, std::memory_order_release)) { - // If CAS succeeded, we set new status and no request occured here, safe to proceed. + // If CAS succeeded, we set new status and no request occurred here, safe to proceed. break; } } diff --git a/runtime/include/mtmanaged_thread.h b/runtime/include/mtmanaged_thread.h index 2a7dc91b26..25930ae58b 100644 --- a/runtime/include/mtmanaged_thread.h +++ b/runtime/include/mtmanaged_thread.h @@ -470,7 +470,7 @@ private: if (no_flags && stor_32_.fts_.as_atomic.compare_exchange_weak( // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) old_fts.as_nonvolatile_int, new_fts.as_nonvolatile_int, std::memory_order_release)) { - // If CAS succeeded, we set new status and no request occured here, safe to proceed. + // If CAS succeeded, we set new status and no request occurred here, safe to proceed. break; } // clang-format on diff --git a/runtime/include/tooling/debug_interface.h b/runtime/include/tooling/debug_interface.h index a1bd76dee1..1ca66df55d 100644 --- a/runtime/include/tooling/debug_interface.h +++ b/runtime/include/tooling/debug_interface.h @@ -138,7 +138,7 @@ using ExceptionWrapper = std::string; // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) struct ThreadInfo { char *name; - size_t name_lenght; + size_t name_length; int32_t priority; bool is_daemon; threadGroup thread_group; diff --git a/runtime/mem/gc/gc.h b/runtime/mem/gc/gc.h index 2380767069..1d047b64ce 100644 --- a/runtime/mem/gc/gc.h +++ b/runtime/mem/gc/gc.h @@ -252,7 +252,7 @@ public: ObjectStatus MarkChecker(const ObjectHeader *object) const { if constexpr (!reversed_mark) { // NOLINTNEXTLINE(readability-braces-around-statements) - // If ClassAddr is not setted - it means object header initialization is in progress now + // If ClassAddr is not set - it means object header initialization is in progress now if (object->AtomicClassAddr() == nullptr) { return ObjectStatus::ALIVE_OBJECT; } diff --git a/runtime/mem/region_space.h b/runtime/mem/region_space.h index 0df56e4039..db3ccf30d7 100644 --- a/runtime/mem/region_space.h +++ b/runtime/mem/region_space.h @@ -193,7 +193,7 @@ public: template static Region *AddrToRegion(const void *addr, size_t mask = DEFAULT_REGION_MASK) { - // if it is possible that (object adress - region start addr) larger than region alignment, + // if it is possible that (object address - region start addr) larger than region alignment, // we should get the region start address from mmappool which records it in allocator info if constexpr (cross_region) { // NOLINTNEXTLINE(readability-braces-around-statements) auto region_addr = PoolManager::GetMmapMemPool()->GetStartAddrPoolForAddr(const_cast(addr)); diff --git a/runtime/options.yaml b/runtime/options.yaml index 7625641802..e660f8536a 100644 --- a/runtime/options.yaml +++ b/runtime/options.yaml @@ -421,7 +421,7 @@ options: - name: profilesaver-delta-number-threshold type: uint64_t default: 0 - description: delta number threashold of newly added method or class for profile saver + description: delta number threshold of newly added method or class for profile saver - name: profilesaver-enabled type: bool diff --git a/runtime/tests/string_test.cpp b/runtime/tests/string_test.cpp index 150e45e4c4..0720bad310 100644 --- a/runtime/tests/string_test.cpp +++ b/runtime/tests/string_test.cpp @@ -268,7 +268,7 @@ TEST_F(StringTest, DifferentLengthStringCompareTest) ASSERT_EQ(String::StringsAreEqual(first_string, second_string), false); } -TEST_F(StringTest, ForeignLenghtAndCopyTest1b0) +TEST_F(StringTest, ForeignLengthAndCopyTest1b0) { std::vector data {'a', 'b', 'c', 'd', 'z', 0xc0, 0x80, 0x00}; uint32_t utf16_length = data.size(); @@ -285,7 +285,7 @@ TEST_F(StringTest, ForeignLenghtAndCopyTest1b0) ASSERT_EQ(out16, res16); } -TEST_F(StringTest, ForeignLenghtAndCopyTest1b) +TEST_F(StringTest, ForeignLengthAndCopyTest1b) { std::vector data {'a', 'b', 'c', 'd', 'z', 0x7f, 0x00}; uint32_t utf16_length = data.size(); @@ -302,7 +302,7 @@ TEST_F(StringTest, ForeignLenghtAndCopyTest1b) ASSERT_EQ(out16, res16); } -TEST_F(StringTest, ForeignLenghtAndCopyTest2b) +TEST_F(StringTest, ForeignLengthAndCopyTest2b) { std::vector data {0xc2, 0xa7, 0x33, 0x00}; // UTF-16 size is 2 String *string = String::CreateFromMUtf8(data.data(), 2, GetLanguageContext(), Runtime::GetCurrent()->GetPandaVM()); @@ -317,7 +317,7 @@ TEST_F(StringTest, ForeignLenghtAndCopyTest2b) ASSERT_EQ(out16, res16); } -TEST_F(StringTest, ForeignLenghtAndCopyTest3b) +TEST_F(StringTest, ForeignLengthAndCopyTest3b) { std::vector data {0xef, 0xbf, 0x83, 0x33, 0x00}; // UTF-16 size is 2 String *string = String::CreateFromMUtf8(data.data(), 2, GetLanguageContext(), Runtime::GetCurrent()->GetPandaVM()); @@ -332,7 +332,7 @@ TEST_F(StringTest, ForeignLenghtAndCopyTest3b) ASSERT_EQ(out16, res16); } -TEST_F(StringTest, ForeignLenghtAndCopyTest6b) +TEST_F(StringTest, ForeignLengthAndCopyTest6b) { std::vector data {0xed, 0xa0, 0x81, 0xed, 0xb0, 0xb7, 0x20, 0x00}; // UTF-16 size is 3 // We support 4-byte utf-8 sequences, so {0xd801, 0xdc37} is encoded to 4 bytes instead of 6 @@ -580,7 +580,7 @@ TEST_F(StringTest, CompareTest) ASSERT_EQ(string6->Compare(string7), 0); ASSERT_EQ(string7->Compare(string6), 0); - // comapre with self + // compare with self ASSERT_EQ(string1->Compare(string1), 0); ASSERT_EQ(string2->Compare(string2), 0); ASSERT_EQ(string3->Compare(string3), 0); diff --git a/runtime/thread.cpp b/runtime/thread.cpp index 689bb11be1..84b3b1e5d3 100644 --- a/runtime/thread.cpp +++ b/runtime/thread.cpp @@ -248,7 +248,7 @@ bool MTManagedThread::IsInNativeCode() const void MTManagedThread::ManagedCodeBegin() { - // thread_frame_states_ should not be accessed without MutatorLock (as runtime could have been destoryed) + // thread_frame_states_ should not be accessed without MutatorLock (as runtime could have been destroyed) UpdateStatus(RUNNING); is_managed_scope_ = true; LOG_IF(HasClearStack(), FATAL, RUNTIME) << "stack should be not empty"; diff --git a/templates/common.rb b/templates/common.rb index 46066d388d..c190d8974b 100755 --- a/templates/common.rb +++ b/templates/common.rb @@ -55,9 +55,9 @@ class Option < SimpleDelegator @expansion_map.each do |k, v| ret = "" if s.include?(k) - splitted = s.split(k); - for i in 1..splitted.length() - 1 - ret += v + ' + ' + Common::to_raw(splitted[i])+ ' + ' + split = s.split(k); + for i in 1..split.length() - 1 + ret += v + ' + ' + Common::to_raw(split[i])+ ' + ' end return ret.delete_suffix(' + ') end diff --git a/tests/cts-generator/cts-template/call.range.yaml b/tests/cts-generator/cts-template/call.range.yaml index ee4c5de0a8..b7e9eaed8c 100644 --- a/tests/cts-generator/cts-template/call.range.yaml +++ b/tests/cts-generator/cts-template/call.range.yaml @@ -276,7 +276,7 @@ tests: - sig: call.range method_id, v:in:top acc: out:top format: [op_v_8_id_16] - description: Check 'call.range' when argument type of function and instuction mismatch. + description: Check 'call.range' when argument type of function and instruction mismatch. header-template: [] code-template: | %s diff --git a/tests/cts-generator/cts-template/call.short.yaml b/tests/cts-generator/cts-template/call.short.yaml index d1d19d211b..a874853266 100644 --- a/tests/cts-generator/cts-template/call.short.yaml +++ b/tests/cts-generator/cts-template/call.short.yaml @@ -261,7 +261,7 @@ tests: - sig: call.short method_id, v1:in:top, v2:in:top acc: out:top format: [op_v1_4_v2_4_id_16] - description: Check 'call.short' when arguments of function and instuction parameters mismatch. + description: Check 'call.short' when arguments of function and instruction parameters mismatch. header-template: [] code-template: | .function void f1(%s) { @@ -301,7 +301,7 @@ tests: - sig: call.short method_id, v1:in:top, v2:in:top acc: out:top format: [op_v1_4_v2_4_id_16] - description: Check 'call.short' when argument type of function and instuction mismatch. + description: Check 'call.short' when argument type of function and instruction mismatch. header-template: [] code-template: | %s diff --git a/tests/cts-generator/cts-template/call.virt.negative.yaml b/tests/cts-generator/cts-template/call.virt.negative.yaml index 602efceac2..a84f56fe6d 100644 --- a/tests/cts-generator/cts-template/call.virt.negative.yaml +++ b/tests/cts-generator/cts-template/call.virt.negative.yaml @@ -506,7 +506,7 @@ tests: description: > Verifier should report when register type does not match function argument type. code-template: | - # Defenitions for all set of tests + # Definitions for all set of tests .record panda.String .record panda.Object @@ -635,7 +635,7 @@ tests: description: > Verifier should report when register type does not match function argument type. code-template: | - # Defenitions for all set of tests + # Definitions for all set of tests .record panda.String .record panda.Object diff --git a/tests/cts-generator/cts-template/call.virt.range.negative.yaml b/tests/cts-generator/cts-template/call.virt.range.negative.yaml index ca98b7a3e2..0cab05ea97 100644 --- a/tests/cts-generator/cts-template/call.virt.range.negative.yaml +++ b/tests/cts-generator/cts-template/call.virt.range.negative.yaml @@ -498,7 +498,7 @@ tests: description: > Verifier should report when register type does not match function argument type. code-template: | - # Defenitions for all set of tests + # Definitions for all set of tests .record panda.String .record panda.Object @@ -624,7 +624,7 @@ tests: description: > Verifier should report when register type does not match function argument type. code-template: | - # Defenitions for all set of tests + # Definitions for all set of tests .record panda.String .record panda.Object diff --git a/tests/cts-generator/cts-template/call.yaml b/tests/cts-generator/cts-template/call.yaml index f3a877cca3..87a1dfa98b 100644 --- a/tests/cts-generator/cts-template/call.yaml +++ b/tests/cts-generator/cts-template/call.yaml @@ -260,7 +260,7 @@ tests: - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top acc: out:top format: [op_v1_4_v2_4_v3_4_v4_4_id_16] - description: Check 'call' when arguments of function and instuction parameters mismatch. + description: Check 'call' when arguments of function and instruction parameters mismatch. header-template: [] code-template: | .function void f1(%s) { @@ -305,7 +305,7 @@ tests: - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top acc: out:top format: [op_v1_4_v2_4_v3_4_v4_4_id_16] - description: Check 'call' when argument type of function and instuction mismatch. + description: Check 'call' when argument type of function and instruction mismatch. header-template: [] code-template: | %s diff --git a/tests/cts-generator/cts-template/lenarr.yaml b/tests/cts-generator/cts-template/lenarr.yaml index f36913d359..682a91837c 100644 --- a/tests/cts-generator/cts-template/lenarr.yaml +++ b/tests/cts-generator/cts-template/lenarr.yaml @@ -51,7 +51,7 @@ tests: description: Get length of an array and put it into accumulator. commands: - file-name: "prim_array" - description: Check 'lenarr' returns correct array lenght with array of primitives. + description: Check 'lenarr' returns correct array length with array of primitives. isa: instructions: - sig: lenarr v:in:top[] @@ -83,7 +83,7 @@ tests: - values: [0x100000] - file-name: "ref_array_p" - description: Check 'lenarr' returns correct array lenght with array of objects in Panda Assembly context. + description: Check 'lenarr' returns correct array length with array of objects in Panda Assembly context. isa: instructions: - sig: lenarr v:in:top[] diff --git a/tests/verifier-tests/issue_1981.pa b/tests/verifier-tests/issue_1981.pa index f4f159afdb..c75fc0ccec 100644 --- a/tests/verifier-tests/issue_1981.pa +++ b/tests/verifier-tests/issue_1981.pa @@ -16,7 +16,7 @@ .function void A.constructor(A a0) { return.void } -# Defenitions for all set of tests +# Definitions for all set of tests .record panda.String .record panda.Object diff --git a/verification/debug/allowlist/allowlist.cpp b/verification/debug/allowlist/allowlist.cpp index d0be5fdf1f..7fe73ac8c9 100644 --- a/verification/debug/allowlist/allowlist.cpp +++ b/verification/debug/allowlist/allowlist.cpp @@ -42,13 +42,13 @@ void AllowlistMethodIdCalculationHandler(uint32_t class_hash, uint32_t method_ha if (static_cast(k) == AllowlistKind::CLASS) { if (name_hash_local[k]->count(class_hash) > 0) { LOG(DEBUG, VERIFIER) << "Method with class hash 0x" << std::hex << class_hash << ", id 0x" << id - << " was succesfully added to allowlist"; + << " was successfully added to allowlist"; id_local[k]->insert(id); } } else { if (name_hash_local[k]->count(method_hash) > 0) { LOG(DEBUG, VERIFIER) << "Method with hash 0x" << std::hex << method_hash << ", id 0x" << id - << " was succesfully added to allowlist"; + << " was successfully added to allowlist"; id_local[k]->insert(id); } } diff --git a/verification/type/tests/type_system_test.cpp b/verification/type/tests/type_system_test.cpp index 6a4885d599..9c730f8365 100644 --- a/verification/type/tests/type_system_test.cpp +++ b/verification/type/tests/type_system_test.cpp @@ -135,7 +135,7 @@ TEST_F(VerifierTest, TypeSystemClosureAtTheEnd) i8 << (i16 | i32) << i64; (u8 | u16) << (u32 | u64); - // bofore closure all methods are unrelated + // before closure all methods are unrelated EXPECT_FALSE(method2 <= method1); EXPECT_FALSE(method1 <= method2); -- Gitee