mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
fix zig argument passing changes in str module
This commit is contained in:
parent
a69bf971f0
commit
5e0b724854
2 changed files with 23 additions and 7 deletions
|
@ -5337,7 +5337,17 @@ fn run_low_level<'a, 'ctx, 'env>(
|
|||
|
||||
let string = load_symbol(scope, &args[0]);
|
||||
|
||||
call_bitcode_fn(env, &[string], intrinsic)
|
||||
let result = call_bitcode_fn(env, &[string], intrinsic);
|
||||
|
||||
// zig passes the result as a packed integer sometimes, instead of a struct. So we cast
|
||||
let expected_type = basic_type_from_layout(env, layout);
|
||||
let actual_type = result.get_type();
|
||||
|
||||
if expected_type != actual_type {
|
||||
complex_bitcast_check_size(env, result, expected_type, "str_to_num_cast")
|
||||
} else {
|
||||
result
|
||||
}
|
||||
}
|
||||
StrFromInt => {
|
||||
// Str.fromInt : Int -> Str
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue