Sean T Allen
Sean T Allen
Here's a more minimal example that gives an error: ```pony class Fu fun bar(t: Array[U8] val) => match t | [ U8(1) ] => false end ``` which results in:...
Note this is reproducible with Pony 0.54.1
> So this is going to be a "turn into a compile-time error" type of solution I expect since implementing literal arrays in a match is a problem that is...
Note this is a variation of https://github.com/ponylang/ponyc/issues/2110 and it appears we missed a case.
This is hitting ```c if(is_typecheck_error(pattern_type)) return NULL ``` in match.c https://github.com/ponylang/ponyc/blob/main/src/libponyc/expr/match.c#L56 We should never hit a typecheck error here, that it should have been caught before this point and the...
Note when using a debug version of the compiler you will get: ``` /home/sean/code/ponylang/ponyc-3/src/libponyc/pass/expr.c:661: pass_expr: Assertion `errors_get_count(options->check. Errors) > 0` failed. ``` as the error message.
Looking in `expr_case`, I see the following: ```c if(ast_checkflag(match_expr, AST_FLAG_JUMPS_AWAY) || is_typecheck_error(match_type)) return false; ``` and the jumps away never gets handled until `make_pattern_type`: ``` if(ast_checkflag(pattern, AST_FLAG_JUMPS_AWAY)) { ast_error(opt->check.errors, pattern,...
I am able to replicate. The commit ( 6806b6b512e0030dc3df765ef756fbcb6b31ebf0 ) where we switched to LLVM 15 introduces the bug. Not it only happens in debug mode, to release mode.
Here's some wonderful LLDB output done with a debug version of the runtime: ``` Process 20953 stopped * thread #3, name = 'nick-seg', stop reason = signal SIGSEGV: invalid address...
So my suspicion based on what I can see... this works in release mode because "the bad code" is being optimized away in release mode. Specifically, I assume that the...