Skip to content

Commit 153ecf6

Browse files
committed
Revert "Fix danmar#470 Crash in simplecpp::Macro::expand() (danmar#555)"
This reverts commit b070df6.
1 parent 13dc4f8 commit 153ecf6

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

simplecpp.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,13 +2035,7 @@ namespace simplecpp {
20352035

20362036
tok = tok->next;
20372037
if (tok == endToken2) {
2038-
if (tok) {
2039-
output.push_back(new Token(*tok->previous));
2040-
}
2041-
else {
2042-
output.push_back(new Token(*nameTokInst));
2043-
output.back()->setstr("\"\"");
2044-
}
2038+
output.push_back(new Token(*tok->previous));
20452039
break;
20462040
}
20472041
if (tok->op == '#') {

test.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,16 +1067,6 @@ static void define_va_opt_7()
10671067
toString(outputList));
10681068
}
10691069

1070-
static void define_va_opt_8()
1071-
{
1072-
const char code[] = "#define f(...) #__VA_OPT__(x)\n"
1073-
"const char* v1 = f();";
1074-
1075-
simplecpp::OutputList outputList;
1076-
ASSERT_EQUALS("\nconst char * v1 = \"\" ;", preprocess(code, &outputList));
1077-
ASSERT_EQUALS("", toString(outputList));
1078-
}
1079-
10801070
static void define_ifdef()
10811071
{
10821072
const char code[] = "#define A(X) X\n"
@@ -3615,7 +3605,6 @@ int main(int argc, char **argv)
36153605
TEST_CASE(define_va_opt_5);
36163606
TEST_CASE(define_va_opt_6);
36173607
TEST_CASE(define_va_opt_7);
3618-
TEST_CASE(define_va_opt_8);
36193608

36203609
TEST_CASE(pragma_backslash); // multiline pragma directive
36213610

0 commit comments

Comments
 (0)