changeset 123:3816844250ff

WIP, one more fix from David
author Louis Opter <louis@lse.epita.fr>
date Sat, 03 Aug 2013 17:34:38 -0700
parents 52402232483f
children ecba077e0f73
files rathaxes_compiler_passes_correctly_resolve_chunk_args_subidentifiers.patch series
diffstat 2 files changed, 40 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rathaxes_compiler_passes_correctly_resolve_chunk_args_subidentifiers.patch	Sat Aug 03 17:34:38 2013 -0700
@@ -0,0 +1,39 @@
+# HG changeset patch
+# User David Pineau <dav.pineau@gmail.com>, Louis Opter <louis@lse.epita.fr>
+# Parent 924908351b124b3fd1180f27880d36ea64e7c01c
+rathaxes: correctly resolve the type of chunk arguments subidentifiers
+
+diff --git a/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws b/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws
+--- a/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws
++++ b/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws
+@@ -744,17 +744,18 @@
+         if (!existVariable(param.rtype))
+         {
+             localref theVar = param.identifiers#[0];
++            local theType;
+             if (theVar.name == "local")
+             {
+                 ref theVar = param.identifiers#[1];
+             }
+-            local theType;
+             if (findElement(theVar.name, theChunk.type_map))
+                 ref theType = theChunk.type_map[theVar.name];
+             else if (findElement(theVar.name, theChunk.variables))
+                 ref theType = theChunk.variables[theVar.name].type_node;
+             insert param.rtype;
+-            if (getArraySize(param.identifiers) > 2)
++            if ((param.identifiers#[0].name != "local" && getArraySize(param.identifiers) > 1)
++                || getArraySize(param.identifiers) > 2)
+             {
+                 local subType;
+                 local fieldList;
+@@ -763,7 +764,8 @@
+                     pushItem fieldList;
+                     fieldList#back = field.name;
+                 }
+-                removeFirstElement(fieldList);
++                if (param.identifiers#[0].name == "local")
++                    removeFirstElement(fieldList);
+                 removeFirstElement(fieldList);
+                 if (rtxTypingLookup_ResolveTypeFields(theType, fieldList, theChunk, theChunk#root /* XXX dummy */, subType) == false)
+                 {
--- a/series	Sun Jul 28 02:50:43 2013 -0700
+++ b/series	Sat Aug 03 17:34:38 2013 -0700
@@ -2,6 +2,7 @@
 rathaxes_compiler_passes_look_for_locally_casted_variables_in_sequence_calls.patch
 rathaxes_compiler_passes_fix_placeholder_identification.patch
 rathaxes_compiler_passes_hack_injection_of_chunks_into_rvalues.patch
+rathaxes_compiler_passes_correctly_resolve_chunk_args_subidentifiers.patch
 rathaxes_samples_e1000_add_a_dma_abstraction.patch
 rathaxes_samples_e1000_use_the_dma_abstraction_in_socket.patch
 rathaxes_samples_e1000_add_ethernet_device_alloc_rx_skbuff.patch