]> 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>
Sun, 27 Sep 2020 17:25:51 +0000 (19:25 +0200)
This resulted in invalid C code:
    error: lvalue required as left operand of assignment

codegen/valaccodebasemodule.vala

index d748284bd774aabbe11472854495f168ed183eba..e782a4a58f4a91419f398b8a56e66adaf3c22eee 100644 (file)
@@ -3717,6 +3717,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));