Move the logic for this into visitBool, where it belongs. Then convert the logical binary operator operands to bool using visitBool() and the result back to int, if needed (which it is in C).
Details
Details
Diff Detail
Diff Detail
Event Timeline
clang/lib/AST/Interp/ByteCodeExprGen.cpp | ||
---|---|---|
531–534 | This is casting to boolean type, not integer type -- shouldn't that be emitting an int? |
clang/lib/AST/Interp/ByteCodeExprGen.cpp | ||
---|---|---|
531–534 | That line is casting from PT_Bool to T, because we visited the operands as bool and now we need to convert back to whatever type we should have. |
Comment Actions
LGTM
clang/lib/AST/Interp/ByteCodeExprGen.cpp | ||
---|---|---|
531–534 | Ah!! That makes more sense, thank you. |
This is casting to boolean type, not integer type -- shouldn't that be emitting an int?