Commit 5b1921e
authored
Fix BOOST_REQUIRE false positives (#7341)
The **BOOST_REQUIRE** macros would not exit early and in case of a
possible null pointer assignment in the condition, it would not get
caught in the macro definition.
This would show false positives in next usages of the condition and show
a `nullPointerOutOfMemory` warning, whereas the **BOOST_REQUIRE** would
have thrown an exception.
Mimic **BOOST_REQUIRE** behavior in the macro.
Added a test for this, also the warning would not show when using
`std::malloc`, but does show up when using `malloc`.1 parent 03aae03 commit 5b1921e
2 files changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
165 | 178 | | |
166 | 179 | | |
167 | 180 | | |
| |||
0 commit comments