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

[ICE] fuzzer reached unreachable code #282

Closed
Byter09 opened this issue Feb 17, 2020 · 1 comment
Closed

[ICE] fuzzer reached unreachable code #282

Byter09 opened this issue Feb 17, 2020 · 1 comment
Labels
bug Something isn't working ICE Internal Compiler Error (panic)

Comments

@Byter09
Copy link
Contributor

Byter09 commented Feb 17, 2020

Expected behavior

It should not panic and give out an error. (To be real, I have no idea if thats even valid code).
Actual Behavior

The application panicked (crashed).
Message:  internal error: entered unreachable code: should have been caught already: Str([0])
Location: src/parse/decl.rs:1609

Code

I[K?*"":""]
Backtrace
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                          (5 post panic frames hidden)                          
 5: rcc::parse::decl::<impl rcc::data::Expr>::const_int::h7558b061c5eecf3b
    at src/parse/decl.rs:1609
 6: rcc::parse::decl::<impl rcc::parse::Parser<I>>::postfix_type::h0c9ab98fd21fcd3d
    at src/parse/decl.rs:1036
 7: rcc::parse::decl::<impl rcc::parse::Parser<I>>::direct_declarator::hf3ef96ced0e3e167
    at src/parse/decl.rs:1168
 8: rcc::parse::decl::<impl rcc::parse::Parser<I>>::declarator::h64451eaa96cd097e
    at src/parse/decl.rs:1250
 9: rcc::parse::decl::<impl rcc::parse::Parser<I>>::declaration::h0d6835c19d8d7262
    at src/parse/decl.rs:79
10: <rcc::parse::Parser<I> as core::iter::traits::iterator::Iterator>::next::{{closure}}::h85b37aec70557a37
    at src/parse/mod.rs:147
11: core::option::Option<T>::or_else::h182c3cc48d3224d6
    at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src/libcore/option.rs:754
12: <rcc::parse::Parser<I> as core::iter::traits::iterator::Iterator>::next::h87a36bb3ea7e59d8
    at src/parse/mod.rs:125
13: <&mut I as core::iter::traits::iterator::Iterator>::next::hb3f95f4dd7848df7
    at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src/libcore/iter/traits/iterator.rs:2991
14: rcc::compile::h089ba22ff0e2d41e
    at src/lib.rs:163
15: rcc::real_main::haaab50c764bab8a4
    at src/main.rs:109
16: rcc::main::hf916b0e3bfc4e703
    at src/main.rs:172
                        (12 runtime init frames hidden)
@Byter09 Byter09 added ICE Internal Compiler Error (panic) bug Something isn't working labels Feb 17, 2020
@jyn514
Copy link
Owner

jyn514 commented Feb 17, 2020

With fixed syntax so clang gives an error:

$ run_clang
int K;
int I[K ? *"" : ""];
<stdin>:2:9: error:
      pointer/integer type mismatch
      in conditional expression
      ('int' and 'char *')
      [-Werror,-Wconditional-type-mismatch]
int I[K ? *"" : ""];
        ^ ~~~   ~~
<stdin>:2:7: error: size of array
      has non-integer type 'char *'
int I[K ? *"" : ""];
      ^~~~~~~~~~~~

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working ICE Internal Compiler Error (panic)
Projects
None yet
Development

No branches or pull requests

2 participants