-
Bug
-
Resolution: Unresolved
-
Medium
-
Code Generation Tools
-
CODEGEN-12833
-
ARMCLANG_3.2.0.LTS
-
ARMCLANG_4.0.2.LTS*
-
default
-
The attached file has a function that begins ...
void Server::assertHandler(etl::string_view description, etl::string_view pretty_function, etl::string_view file, uint32_t line) { static bool assert_fired = false; // Protection from the infinite calling to the handler // if some of the code bellow triggers the assert. if (!assert_fired) { assert_fired = true;
Build it ...
% tiarmclang @options.txt file.cpp
Ignore the warning and note diagnostics.
Create the interlisted, demangled, disassembly with the command ...
% tiarmobjdump --demangle --source file.o > disassembly.txt
Inspect the disassembly to find the function begins ...
00000000 <figure::lib::logger::Server::assertHandler(etl::basic_string_view<char, etl::char_traits<char>>, etl::basic_string_view<char, etl::char_traits<char>>, etl::basic_string_view<char, etl::char_traits<char>>, unsigned int)>: ; etl::string_view file, uint32_t line) { 0: b08c sub sp, #48 ; : mbegin(begin_) 2: f240 0700 movw r7, #0 ; assert_fired = true;
The static variable is assert_fired is assigned the value 1 without the conditional check that appears in the C++ source.