changeset 124:ecba077e0f73

WIP
author Louis Opter <louis@lse.epita.fr>
date Sat, 03 Aug 2013 20:14:51 -0700
parents 3816844250ff
children 3a92a43a3215
files rathaxes_compiler_passes_fix_reference_reuse.patch series wip.patch
diffstat 3 files changed, 68 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rathaxes_compiler_passes_fix_reference_reuse.patch	Sat Aug 03 20:14:51 2013 -0700
@@ -0,0 +1,38 @@
+# HG changeset patch
+# User David Pineau <dav.pineau@gmail.com>, Louis Opter <louis@lse.epita.fr>
+# Parent 732233e9a7ba6638d5c75ed277fce8d6de626601
+rathaxes: fix an issue raised by re-using a reference to the ResVals
+
+Fixes incorrectly generated rathaxes variable expansion.
+
+diff --git a/rathaxes/compiler/passes/common/rtxResolve.inc.cws b/rathaxes/compiler/passes/common/rtxResolve.inc.cws
+--- a/rathaxes/compiler/passes/common/rtxResolve.inc.cws
++++ b/rathaxes/compiler/passes/common/rtxResolve.inc.cws
+@@ -340,6 +340,7 @@
+         if (existVariable(dst_p.identifiers))
+             ref param_name = dst_p.identifiers#front.name;
+         local param_type;
++        local param_src_value;
+         local param_value;
+         local src_arg;
+ 
+@@ -375,9 +376,10 @@
+                 if (rtxNodeArg_getRType(src_arg, param_type) == false)
+                     return false;
+                 setall resolver_type = param_type;
+-                if (rtxNodeArg_getValue(src_arg, param_value) == false)
++                if (rtxNodeArg_getValue(src_arg, param_src_value) == false)
+                     return false;
+ 
++                setall param_value = param_src_value;
+                 // In case a recursive resolution is necessary, we need to setup a "self"
+                 rtxNodeArgs_AppendArg(subResVal, "self", resolver_type, param_value);
+             }
+@@ -443,6 +445,7 @@
+                 local src_arg;
+                 local src_name = param_value.id;
+                 if (rtxNodeArgs_GetArgByName(src_resVals, src_name, src_arg))
++                    return false;
+                 if (rtxNodeArg_getRType(src_arg, param_type) == false)
+                     return false;
+                 if (rtxNodeArg_getValue(src_arg, param_value) == false)
--- a/series	Sat Aug 03 17:34:38 2013 -0700
+++ b/series	Sat Aug 03 20:14:51 2013 -0700
@@ -2,8 +2,10 @@
 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_compiler_passes_correctly_resolve_chunk_args_subidentifiers.patch #+test
 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
 rathaxes_samples_e1000_split_set_up_device.patch
+rathaxes_compiler_passes_fix_reference_reuse.patch
+wip.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wip.patch	Sat Aug 03 20:14:51 2013 -0700
@@ -0,0 +1,27 @@
+# HG changeset patch
+# Parent 67dc97cbe736ead44d6c596eb339829a41c4b847
+diff --git a/rathaxes/compiler/passes/common/rtxResolve.inc.cws b/rathaxes/compiler/passes/common/rtxResolve.inc.cws
+--- a/rathaxes/compiler/passes/common/rtxResolve.inc.cws
++++ b/rathaxes/compiler/passes/common/rtxResolve.inc.cws
+@@ -388,7 +388,20 @@
+                 // Argument comes from the Chunk, so we retrieve the *real* type
+                 // That will be resolved after the "local" resolution.
+ 
+-                rtxResolve_BuildLocalSelf(subResVal, theChunk, placeHolder, subidentifiers);
++                if (subidentifiers#front == "local")
++                    rtxResolve_BuildLocalSelf(subResVal, theChunk, placeHolder, subidentifiers);
++                else
++                {
++                    local src_arg;
++                    local src_type;
++                    local src_value;
++                    rtxNodeArgs_GetArgByName(src_resVals, "self", src_arg);
++                    if (rtxNodeArg_getRType(src_arg, src_type) == false)
++                        return false;
++                    if (rtxNodeArg_getValue(src_arg, src_value) == false)
++                        return false;
++                    rtxNodeArgs_AppendArg(subResVal, "self", src_type, src_value);
++                }
+                 local local_self;
+                 rtxNodeArgs_GetArgByName(subResVal, "self", local_self);
+                 local local_type;