Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

[ICE] bug in parser: loaded a variable that was not declared #473

Open
Byter09 opened this issue Jun 8, 2020 · 1 comment
Open

[ICE] bug in parser: loaded a variable that was not declared #473

Byter09 opened this issue Jun 8, 2020 · 1 comment
Labels
ICE Internal Compiler Error (panic)

Comments

@Byter09
Copy link
Contributor

Byter09 commented Jun 8, 2020

Code

union u2 u2a;

unions()
{
    u2a ;
}

Expected behavior

Not really a C expert so I have no clue :)

Backtrace
The application panicked (crashed).
Message:  bug in parser: loaded a variable that was not declared
Location: /storage/saltwater/src/ir/expr.rs:417

Run with RUST_BACKTRACE=full to include source snippets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                              ⋮ 4 frames hidden ⋮                               
 5: core::panicking::panic_fmt::h1ac71ad045d55416
    at src/libcore/panicking.rs:111
 6: core::option::expect_failed::h7baa1c60813ff0e3
    at src/libcore/option.rs:1260
 7: core::option::Option<T>::expect::haf0fc5ded7f49bbc
    at /rustc/49cae55760da0a43428eba73abcb659bb70cf2e4/src/libcore/option.rs:347
 8: saltwater::ir::expr::<impl saltwater::ir::Compiler<B>>::load_addr::h96d89eb40825f3f0
    at /storage/saltwater/src/ir/expr.rs:417
 9: saltwater::ir::expr::<impl saltwater::ir::Compiler<B>>::compile_expr::hdc8bc448035e1104
    at /storage/saltwater/src/ir/expr.rs:42
10: saltwater::ir::stmt::<impl saltwater::ir::Compiler<B>>::compile_stmt::h33303ef196213b5a
    at /storage/saltwater/src/ir/stmt.rs:41
11: saltwater::ir::stmt::<impl saltwater::ir::Compiler<B>>::compile_all::ha6f77f726593b383
    at /storage/saltwater/src/ir/stmt.rs:19
12: saltwater::ir::Compiler<B>::compile_func::h06b4843792beea31
    at /storage/saltwater/src/ir/mod.rs:354
13: saltwater::ir::compile::h57a6ec8de4266bb2
    at /storage/saltwater/src/ir/mod.rs:133
14: saltwater::compile::h450fea7b729b8e55
    at /storage/saltwater/src/lib.rs:303
15: swcc::aot_main::hedfb546d31e85013
    at src/main.rs:175
16: swcc::real_main::hbda82e0ba7f269af
    at src/main.rs:164
@Byter09 Byter09 added the ICE Internal Compiler Error (panic) label Jun 8, 2020
@jyn514
Copy link
Owner

jyn514 commented Jun 8, 2020

$ run_clang 
union u2 u2a;

unions()
{
    u2a ;
}
<stdin>:3:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
unions()
^
<stdin>:5:5: error: incomplete type 'union u2' where a complete type is required
    u2a ;
    ^
<stdin>:1:7: note: forward declaration of 'union u2'
union u2 u2a;
      ^
<stdin>:5:5: warning: expression result unused [-Wunused-value]
    u2a ;
    ^~~
<stdin>:1:10: error: tentative definition has type 'union u2' that is never completed
union u2 u2a;
         ^
<stdin>:1:7: note: forward declaration of 'union u2'
union u2 u2a;
      ^
2 warnings and 2 errors generated.

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

No branches or pull requests

2 participants