Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

[ICE] the lexer and the preprocessor have trouble getting along #394

Closed
jyn514 opened this issue May 1, 2020 · 0 comments · Fixed by #437
Closed

[ICE] the lexer and the preprocessor have trouble getting along #394

jyn514 opened this issue May 1, 2020 · 0 comments · Fixed by #437
Labels
fuzz Found via fuzz testing ICE Internal Compiler Error (panic) preprocessor Issue in the preprocessor (probably cycle detection)

Comments

@jyn514
Copy link
Owner

jyn514 commented May 1, 2020

Code

#if\

2/
Message:  expected `tokens_until_newline()` to reset `seen_line_token`, but `lexer.peek()` is Some(47)
Location: src/lex/cpp.rs:411

Expected behavior

When the preprocessor calls consume_whitespace, it consumes all the whitespace, not just the single line.

Backtrace
The application panicked (crashed).
Message:  expected `tokens_until_newline()` to reset `seen_line_token`, but `lexer.peek()` is Some(47)
Location: src/lex/cpp.rs:411

Run with RUST_BACKTRACE=full to include source snippets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                          (5 post panic frames hidden)                          
 5: rcc::lex::cpp::PreProcessor::tokens_until_newline::he745648b9c6da68d
    at src/lex/cpp.rs:411
 6: rcc::lex::cpp::PreProcessor::cpp_expr::hd2d583d5b383188b
    at src/lex/cpp.rs:830
 7: rcc::lex::cpp::PreProcessor::boolean_expr::hdaf7ae73e633a95f
    at src/lex/cpp.rs:738
 8: rcc::lex::cpp::PreProcessor::directive::hcba5a304072f52d6
    at src/lex/cpp.rs:502
 9: <rcc::lex::cpp::PreProcessor as core::iter::traits::iterator::Iterator>::next::hb4b76254fce30a67
    at src/lex/cpp.rs:209
10: rcc::check_semantics::hd31cdd4033b22724
    at src/lib.rs:170
11: rcc::compile::h7e7691f880c5ebf4
    at /home/joshua/src/rust/rcc/src/lib.rs:218
12: rcc::aot_main::h8def1ca0324b8884
    at src/main.rs:134
13: rcc::real_main::h192812ffe776ee2f
    at src/main.rs:122
14: rcc::main::hc67a23664e8d7b5c
    at src/main.rs:200
@jyn514 jyn514 added ICE Internal Compiler Error (panic) preprocessor Issue in the preprocessor (probably cycle detection) fuzz Found via fuzz testing labels May 1, 2020
@jyn514 jyn514 linked a pull request May 25, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fuzz Found via fuzz testing ICE Internal Compiler Error (panic) preprocessor Issue in the preprocessor (probably cycle detection)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant