]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Don't pass CCodeFunctionCall to NULL-aware free macro
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 27 Sep 2020 17:21:37 +0000 (19:21 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 29 Sep 2020 10:25:38 +0000 (12:25 +0200)
This resulted in invalid C code:
    error: lvalue required as left operand of assignment

codegen/valaccodebasemodule.vala

index 9318bc721a5f139a08f649bf24cdee84d4b69dda..b87cf2974ca7fa539127eaea892a3dc070962915 100644 (file)
@@ -3568,6 +3568,8 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        // FIXME this breaks in our macro, so this should not happen
                        if (cvar is CCodeCastExpression) {
                                cvar = ((CCodeCastExpression) cvar).inner;
+                       } else if (cvar is CCodeFunctionCall) {
+                               cvar = ((CCodeFunctionCall) cvar).get_arguments ()[0];
                        }
 
                        ccall = new CCodeFunctionCall (new CCodeIdentifier (free0_func));