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

Unused parameter causes Segmentation fault #19853

Closed
MCausc78 opened this issue Nov 12, 2023 · 0 comments · Fixed by #19856
Closed

Unused parameter causes Segmentation fault #19853

MCausc78 opened this issue Nov 12, 2023 · 0 comments · Fixed by #19856
Assignees
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@MCausc78
Copy link
Contributor

MCausc78 commented Nov 12, 2023

Describe the bug

<Title>

Reproduction Steps

fn f(g fn (int) string) {
    println('function returned: ${g(42)}')
}

fn main() {
    f(|_| 'hello world')
}

Expected Behavior

Successful compile and output:

function returned: hello world

Current Behavior

PS D:\Games\Proekti\V\bfc> v run issue.v
Unhandled Exception 0xC0000005
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:21055: at print_backtrace_skipping_top_frames_tcc: Backtrace
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:21022: by print_backtrace_skipping_top_frames
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:21794: by unhandled_exception_handler
7ffd17a3c5fa : by ???
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:32795: at v__checker__Checker_lambda_expr_fix_type_of_param: RUNTIME ERROR: invalid memory access
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:32674: by v__checker__Checker_lambda_expr
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:21691: by v__checker__Checker_expr
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:28567: by v__checker__Checker_fn_call
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:27922: by v__checker__Checker_call_expr
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:21435: by v__checker__Checker_expr
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:20705: by v__checker__Checker_stmt
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:21225: by v__checker__Checker_stmts_ending_with_expression
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:21201: by v__checker__Checker_stmts
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:27757: by v__checker__Checker_fn_decl
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:20737: by v__checker__Checker_stmt
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:18813: by v__checker__Checker_check
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:18880: by v__checker__Checker_check_files
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:47238: by v__builder__Builder_middle_stages
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:47272: by v__builder__Builder_front_and_middle_stages
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:50246: by v__builder__cbuilder__gen_c
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:50229: by v__builder__cbuilder__build_c
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:50219: by v__builder__cbuilder__compile_c
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:50116: by v__builder__Builder_rebuild
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:48766: by v__builder__compile
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:50560: by main__rebuild
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:50449: by main__main
C:/Users/mclr/AppData/Local/Temp/v_0/v2.16864451495970952380.tmp.c:51219: by wmain
00c71bc0 : by ???
00c71d23 : by ???

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.3 fbb43f5

Environment details (OS name and version, etc.)

V full version: V 0.4.3 140c838.fbb43f5
OS: windows, Microsoft Windows 11 Pro v22000 64-bit
Processor: 12 cpus, 64bit, little endian,

getwd: D:\Games\Proekti\V\bfc
vexe: D:\Games\Proekti\V\v\v.exe
vexe mtime: 2023-11-12 18:35:08

vroot: OK, value: D:\Games\Proekti\V\v
VMODULES: OK, value: C:\Users\mclr.vmodules
VTMP: OK, value: C:\Users\mclr\AppData\Local\Temp\v_0

Git version: git version 2.37.0.windows.1
Git vroot status: weekly.2023.44-117-gfbb43f5a
.git/config present: true

CC version:
thirdparty/tcc status: thirdparty-windows-amd64 e90c2620

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.

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants