c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Violated assert: hi_offset + llvm_store_size(c, hi) <= type_size(decl->type)

Open iKryxx opened this issue 2 weeks ago • 1 comments

⚠️ The compiler encountered an unexpected error: "Violated assert: hi_offset + llvm_store_size(c, hi) <= type_size(decl->type)".

  • Function: llvm_process_parameter_value_inner(...)
  • Source file: /home/runner/work/c3c/c3c/src/compiler/llvm_codegen_function.c:157

This issue occurs when running this code:

    Vec3f eye = {2.0f, 2.0f, 2.0f};
    Vec3f center = {0.0f, 0.0f, 0.0f};
    Vec3f up = {0.0f, 1.0f, 0.0f};
    Mat4f view = mat4::look_at(eye, center, up);

When commenting out the call to mat4::look_at(), compilation succeeds. The body of the function doesn't seem to matter, as a simple return {} also lets it crash.

This is the signature: fn Mat4f look_at(Vec3f eye, Vec3f target, Vec3f up) inside the generic module engine::math::mat4 {Type}.

Vec3f is a generic Type of Vec3, declared via alias Vec3f = Vec3 {float}. Same goes for Mat4f

Vec3 is defined as follow:

struct Vec3 {
    union {
        struct {
            Type x;
            Type y;
            Type z;
        }
        Type[<3>] inner;
    }
}

Vec4 is defined similar, but has more members (16 size vector, more inside substruct).

iKryxx avatar Dec 05 '25 14:12 iKryxx

This should work now, please try it.

lerno avatar Dec 05 '25 19:12 lerno