Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling $veb.html() generates cgen error #21929

Closed
ratkingsminion opened this issue Jul 24, 2024 · 0 comments · Fixed by #21961
Closed

Calling $veb.html() generates cgen error #21929

ratkingsminion opened this issue Jul 24, 2024 · 0 comments · Fixed by #21961
Labels
Bug This tag is applied to issues which reports bugs. Compiler Panic The V compiler itself paniced. It should not, it should produce nice and readable errors instead. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Checker Bugs/feature requests, that are related to the type checker.

Comments

@ratkingsminion
Copy link

ratkingsminion commented Jul 24, 2024

V doctor:

V full version: V 0.4.6 8a0fc25.eb63cda
OS: linux, Linux Mint 21.3
Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz

getwd: /home/friedrich/Dev/Projects/Web/Tests/blog_v
vexe: /home/friedrich/Tools/v/v
vexe mtime: 2024-07-24 19:56:05

vroot: OK, value: /home/friedrich/Tools/v
VMODULES: OK, value: /home/friedrich/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.34.1
Git vroot status: weekly.2024.29-35-geb63cda0
.git/config present: true

CC version: cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
thirdparty/tcc status: thirdparty-linux-amd64 a0799a5b

What did you do?
./v -g -o vdbg cmd/v && ./vdbg blog.v

module main

fn main() {
    $veb.html("index.html")
}

index.html is just a file with <html></html> inside.

What did you expect to see?

No error. Ideally a result struct with the generated html code of the template.

What did you see instead?

================ V panic ================
   module: builtin
 function: get()
  message: array.get: index out of range (i == 0, a.len == 0)
     file: /home/friedrich/Tools/v/vlib/builtin/array.v:445
   v hash: eb63cda
=========================================
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/builtin/builtin.c.v:83: at panic_debug: Backtrace
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/builtin/array.v:445: by array_get
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/v/gen/c/comptime.v:123: by v__gen__c__Gen_comptime_call
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/v/gen/c/cgen.v:3473: by v__gen__c__Gen_expr
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/v/gen/c/cgen.v:2210: by v__gen__c__Gen_stmt
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/v/gen/c/cgen.v:1961: by v__gen__c__Gen_stmts_with_tmp_var
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/v/gen/c/cgen.v:1848: by v__gen__c__Gen_stmts
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/v/gen/c/fn.v:486: by v__gen__c__Gen_gen_fn_decl
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/v/gen/c/fn.v:111: by v__gen__c__Gen_fn_decl
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/v/gen/c/cgen.v:2227: by v__gen__c__Gen_stmt
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/v/gen/c/cgen.v:1961: by v__gen__c__Gen_stmts_with_tmp_var
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/v/gen/c/cgen.v:1848: by v__gen__c__Gen_stmts
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/v/gen/c/cgen.v:789: by v__gen__c__Gen_gen_file
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/v/gen/c/cgen.v:738: by v__gen__c__cgen_process_one_file_cb
/tmp/v_1000/../../../../../../home/friedrich/Tools/v/vlib/sync/pool/pool.c.v:118: by sync__pool__process_in_thread
/tmp/v_1000/vdbg.01J3KAPT875EXV1ESRE37QER4D.tmp.c:11864: by sync__pool__process_in_thread_thread_wrapper
7feb4e00eac3 : by ???

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@spytheman spytheman added Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Checker Bugs/feature requests, that are related to the type checker. Compiler Panic The V compiler itself paniced. It should not, it should produce nice and readable errors instead. labels Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Compiler Panic The V compiler itself paniced. It should not, it should produce nice and readable errors instead. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Checker Bugs/feature requests, that are related to the type checker.
Projects
None yet
2 participants