-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix address sanitize reported stack-use-after-scope #1721
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ execute_process(COMMAND uname -p OUTPUT_VARIABLE HOST_ARCH) | |
string(TOLOWER ${HOST_ARCH} HOST_ARCH) | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE RElEASE) | ||
set(CMAKE_BUILD_TYPE RELEASE) | ||
endif() | ||
|
||
string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE) | ||
|
@@ -46,7 +46,7 @@ elseif(${BUILD_TYPE} STREQUAL MINSIZEREL) | |
elseif(${BUILD_TYPE} STREQUAL RELWITHDEBINFO) | ||
set(LIB_BUILD_TYPE RELWITHDEBINFO) | ||
else() | ||
set(LIB_BUILD_TYPE RElEASE) | ||
set(LIB_BUILD_TYPE RELEASE) | ||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") | ||
endif() | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the provided code patch, there are a few changes made to the CMakeLists.txt file. Here's a brief code review:
Overall, the code changes seem to fix spelling errors related to the |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code patch you provided appears to be correcting a typo in setting the CMAKE_BUILD_TYPE and LIB_BUILD_TYPE variables. Here are my observations and suggestions:
Line 34: The
COMMAND uname -p OUTPUT_VARIABLE HOST_ARCH
might need to be enclosed in double quotes to ensure proper execution.Lines 35-37: The
string(TOLOWER ${HOST_ARCH} HOST_ARCH)
converts the value of${HOST_ARCH}
to lowercase. Make sure this is the desired behavior.Lines 40-42: The condition checks if
CMAKE_BUILD_TYPE
is empty (NOT CMAKE_BUILD_TYPE
). If it's empty, it setsCMAKE_BUILD_TYPE
to "RELEASE". This ensures thatCMAKE_BUILD_TYPE
is always set to a valid value.Lines 47-48: Similar to the previous point, these lines handle the case where
${BUILD_TYPE}
is not recognized. It will setLIB_BUILD_TYPE
to "RELEASE" and updateCMAKE_CXX_FLAGS_RELEASE
with the desired optimization flags.Overall, the code patch seems to address potential issues and improve consistency by ensuring that the build types are consistently set to "RELEASE" when not explicitly defined. However, without a complete understanding of the context and the rest of the code, it is difficult to provide a comprehensive review. It would be helpful to provide more details about the purpose and context of this code for a more accurate assessment.