File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,12 @@ endif()
19
19
20
20
if (ANALYZE_UNDEFINED )
21
21
add_compile_options (-fsanitize=undefined )
22
+ add_compile_options (-fsanitize=nullability )
23
+ add_compile_options (-fsanitize=integer )
22
24
add_compile_options (-fno-sanitize-recover=all )
23
25
add_compile_options (-fno-omit-frame-pointer )
24
26
25
- set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined" )
27
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=integer -fsanitize=nullability " )
26
28
endif ()
27
29
28
30
if (ANALYZE_DATAFLOW )
Original file line number Diff line number Diff line change @@ -2203,14 +2203,19 @@ namespace simplecpp {
2203
2203
continue ;
2204
2204
}
2205
2205
// get previous subpath
2206
- const std::string::size_type pos1 = path.rfind (' /' , pos - 1U ) + 1U ;
2207
- const std::string previousSubPath = path.substr (pos1, pos-pos1);
2206
+ std::string::size_type pos1 = path.rfind (' /' , pos - 1U );
2207
+ if (pos1 == std::string::npos) {
2208
+ pos1 = 0 ;
2209
+ } else {
2210
+ pos1 += 1U ;
2211
+ }
2212
+ const std::string previousSubPath = path.substr (pos1, pos - pos1);
2208
2213
if (previousSubPath == " .." ) {
2209
2214
// don't simplify
2210
2215
++pos;
2211
2216
} else {
2212
2217
// remove previous subpath and ".."
2213
- path.erase (pos1,pos- pos1+ 4 );
2218
+ path.erase (pos1, pos - pos1 + 4 );
2214
2219
if (path.empty ())
2215
2220
path = " ." ;
2216
2221
// update pos
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ class TestSamples : public TestFixture {
168
168
es >> std::oct >> c;
169
169
++from;
170
170
++from;
171
- myErr.push_back (c );
171
+ myErr.push_back (static_cast < char >(c) );
172
172
} else {
173
173
myErr.push_back (*from);
174
174
}
You can’t perform that action at this time.
0 commit comments