File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
crates/rune/src/compile/v1 Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -2920,18 +2920,16 @@ fn expr_unary<'a, 'hir>(
2920
2920
span : & ' hir dyn Spanned ,
2921
2921
needs : & mut dyn Needs < ' a , ' hir > ,
2922
2922
) -> compile:: Result < Asm < ' hir > > {
2923
- converge ! ( expr( cx, & hir. expr, needs) ?) ;
2924
-
2925
- let Some ( addr) = needs. try_as_addr ( ) ? else {
2926
- return Ok ( Asm :: new ( span, ( ) ) ) ;
2927
- } ;
2923
+ let mut addr = cx. scopes . defer ( span) ;
2924
+ converge ! ( expr( cx, & hir. expr, & mut addr) ?, free( addr) ) ;
2925
+ let addr = addr. into_addr ( ) ?;
2928
2926
2929
2927
match hir. op {
2930
2928
ast:: UnOp :: Not ( ..) => {
2931
2929
cx. asm . push (
2932
2930
Inst :: Not {
2933
2931
addr : addr. addr ( ) ,
2934
- out : addr . output ( ) ,
2932
+ out : needs . alloc_output ( ) ? ,
2935
2933
} ,
2936
2934
span,
2937
2935
) ?;
@@ -2940,7 +2938,7 @@ fn expr_unary<'a, 'hir>(
2940
2938
cx. asm . push (
2941
2939
Inst :: Neg {
2942
2940
addr : addr. addr ( ) ,
2943
- out : addr . output ( ) ,
2941
+ out : needs . alloc_output ( ) ? ,
2944
2942
} ,
2945
2943
span,
2946
2944
) ?;
@@ -2953,6 +2951,7 @@ fn expr_unary<'a, 'hir>(
2953
2951
}
2954
2952
}
2955
2953
2954
+ addr. free ( ) ?;
2956
2955
Ok ( Asm :: new ( span, ( ) ) )
2957
2956
}
2958
2957
You can’t perform that action at this time.
0 commit comments