diff rathaxes_compiler_passes_fix_ref_scalar_issues_with_chunk_parameters.patch @ 129:518d9c8ac70c

Clean-up the patch queue
author Louis Opter <louis@lse.epita.fr>
date Mon, 02 Sep 2013 22:59:30 -0700
parents 72b5b4a62cc5
children
line wrap: on
line diff
--- a/rathaxes_compiler_passes_fix_ref_scalar_issues_with_chunk_parameters.patch	Mon Aug 26 22:53:34 2013 -0700
+++ b/rathaxes_compiler_passes_fix_ref_scalar_issues_with_chunk_parameters.patch	Mon Sep 02 22:59:30 2013 -0700
@@ -65,7 +65,21 @@
          if (instanceChunk<chunkTree.instanceKey>(resVals, chunkTree.body, source_tree) == false)
          {
              increment(errcount);
-@@ -716,6 +735,8 @@
+@@ -710,17 +729,29 @@
+             // First, try to retrieve value from previous resVals, otherwise build it from chunk
+             if (varName != "self")
+             {
++                //
++                // XXX Note: Here, we may encounter some issues if the chunk's type_map isnt properly filled
++                // (encountered once, the type was scalar instead of ref)
++                //
++                local self_reftype = "scalar";
++                local self_rtype;
+                 if (rtxNodeArgs_GetArgByName(resolverValues, varName, self) == true)
+                 {
+                     rtxNodeArg_getValue(self, self_value);
++                    rtxNodeArg_getRType(self, self_rtype);
++                    self_reftype = self_rtype.qualifier;
                  }
                  else
                  {
@@ -74,3 +88,12 @@
                      clearVariable(self_value);
                      cnormNode_TerminalId(self_value, varName);
                  }
+-                rtxNodeArgs_AppendArg(resVal, "self", theChunk.type_map[varName], self_value);
+-                setall self_type = theChunk.type_map[varName];
++                setall self_rtype = theChunk.type_map[varName];
++                self_rtype.qualifier = self_reftype;
++                rtxNodeArgs_AppendArg(resVal, "self", self_rtype, self_value);
++                setall self_type = self_rtype;
+             }
+             else
+             {