Skip to content

Commit b2208da

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
Fix string-conversion issue in cinderx/Shadowcode/shadowcode.c +1
Summary: This could is triggering `-Wstring-conversion`, which presents as: ``` warning: implicit conversion turns string literal into bool: A to B ``` This is often a bug and what was intended. The most frequent cause is the code was: ``` void foo(bool) { ... } void foo(std::string) { ... } foo("this gets interpreted as a bool"); ``` It is also possible the issue is innocuous as part of an assert: ``` assert(!"this string is true, so the assertion is false"); EXPECT_FALSE("this string is true, so the expect fails"); ``` in these cases the use is to "cute", so we modify the code to make it more obvious. ``` assert(false && "the compiler recognizes and doesn't complain about this pattern"); FAIL() << "much more obvious"; ``` Reviewed By: alexmalyshev Differential Revision: D92528315 fbshipit-source-id: 3d6c932d59b0205d77dd60e17b4104a50747309d
1 parent 4bf6a30 commit b2208da

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

cinderx/Shadowcode/shadowcode.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -993,8 +993,6 @@ void _PyShadow_InitGlobal(
993993
return;
994994
}
995995

996-
assert("Shadowcode broken");
997-
998996
PyObject** cache = Ci_GetGlobalCache(builtins, globals, name);
999997
if (cache == NULL) {
1000998
return;

0 commit comments

Comments
 (0)