Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Compiler assert when using a module-scope pointer variable #2446

@NotsoanoNimus

Description

@NotsoanoNimus

Repro:

module other_module;
int[] list_of_ints = { 1, 2, 3 };
int* ref_to_2nd = &list_of_ints[1];

module somemain;
import other_module, std;
fn void main() => @pool()
{
    io::printfn("ptr %p", other_module::ref_to_2nd);
}

Honestly, the reason this happened would take too much to write out lol.

Output:

> ./build/c3c compile-run somemain.c3
⚠️ The compiler encountered an unexpected error: "Violated assert: !llvm_is_global_eval(c)".

- Function: llvm_load(...)
- Source file: ../src/compiler/llvm_codegen_storeload.c:78

🙏 Please consider taking the time to file an issue on GitHub, so that we can get it fixed:

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingFixed needs testingNeeds verification / testing that it now works

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions