v.gen.c: fix calling pointer receiver on function return result (#10866)
parent
eed4f50d8c
commit
de39bba7bd
|
@ -762,8 +762,13 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
|
|||
// Add `&` automatically.
|
||||
// TODO same logic in call_args()
|
||||
if !is_range_slice {
|
||||
if !node.left.is_lvalue() {
|
||||
g.write('ADDR($rec_cc_type, ')
|
||||
has_cast = true
|
||||
} else {
|
||||
g.write('&')
|
||||
}
|
||||
}
|
||||
} else if !node.receiver_type.is_ptr() && node.left_type.is_ptr() && node.name != 'str'
|
||||
&& node.from_embed_type == 0 {
|
||||
if !node.left_type.has_flag(.shared_f) {
|
||||
|
|
Loading…
Reference in New Issue