[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-683-gc10a9d1

ontologiae ontologiae at gmail.com
Sun Dec 5 13:40:19 UTC 2010


The following commit has been merged in the master branch:
commit c10a9d14c8b0a2fb37c2cd6a4d2f9c6f086f9410
Author: ontologiae <ontologiae at gmail.com>
Date:   Sun Dec 5 14:38:34 2010 +0100

    Fix a bug with put_to.li. It was a call on null on make because type_generic.native_array_variable was not initialized when we used a native_array_volatile

diff --git a/lib/internal/os_support/x86/system/system.li b/lib/internal/os_support/x86/system/system.li
index 35f80fd..a94abd2 100755
--- a/lib/internal/os_support/x86/system/system.li
+++ b/lib/internal/os_support/x86/system/system.li
@@ -103,7 +103,7 @@ Section Public
     capacity := (capacity + REGISTER.ax + 1024) << 10;
     
     */
-/* // Pose trop de problème à la compil
+ // Pose trop de problème à la compil
 
    // BUG COMPIL !!! Line #74 Column #27 in PUT_TO (.../src/external/put_to.li). Call On NULL
     all_memory := CONVERT(POINTER,NATIVE_ARRAY_VOLATILE(INTEGER_8)).on get_begin_memory; 
@@ -118,11 +118,11 @@ Section Public
       all_memory.force_put 0 to ((capacity.to_uinteger_64.to_uinteger_32) + 1); // Cache invalidation for old x86 generation
       //`print_char('0')`;
     }.do_until {byte != ~all_memory.item (capacity.to_uinteger_64.to_uinteger_32)};
-    */
+    
     `/*BSBS MEM*/`;
     
-    //capacity
-    8388608 // 8Mb
+    capacity
+    //8388608 // 8Mb
   );
   
   // Other Features
diff --git a/lib/internal/portable/collection/native_array_volatile.li b/lib/internal/portable/collection/native_array_volatile.li
index e5589c7..5557533 100644
--- a/lib/internal/portable/collection/native_array_volatile.li
+++ b/lib/internal/portable/collection/native_array_volatile.li
@@ -41,6 +41,8 @@ Section Public
   // Basic features:
   //
 
+  - size : UINTEGER_32;
+
   - object_size:INTEGER := 0; // For detect error.
 
   - element_sizeof:INTEGER <-
@@ -66,7 +68,7 @@ Section Public
 
     capacity := nb_elements * element_sizeof;
     //p := `malloc(@capacity)`:POINTER;
-    p := MEMORY.alloc_dynamic (capacity.to_uinteger_32);
+    p := MEMORY.alloc_dynamic (capacity.to_uinteger_cpu);
     result := CONVERT(POINTER,NATIVE_ARRAY_VOLATILE(V)).on p;
     result
   )
@@ -83,6 +85,7 @@ Section Public
   ( + result:NATIVE_ARRAY_VOLATILE(V);
 
     result:=calloc_intern nb_elements;
+    size := nb_elements;
     result.clear_all (nb_elements-1);
     result
   )
@@ -90,6 +93,20 @@ Section Public
     +? {Result.all_default (nb_elements-1)};
   ];
 
+
+  
+  - copy_at adres:UINTEGER_32 : NATIVE_ARRAY_VOLATILE(V) <-
+  ( + capa : UINTEGER_32;
+    + p,adr :POINTER;
+    + result : NATIVE_ARRAY_VOLATILE(V);
+    p := to_pointer;
+    adr := adres.to_pointer;
+    capa := size*element_sizeof; //  element count by element size
+    `memcpy( @adr, @p, @capa)`;
+    result := CONVERT(POINTER,NATIVE_ARRAY_VOLATILE(V)).on adr;
+    result
+  );
+
   - realloc old_nb_elts:INTEGER with new_nb_elts:INTEGER :NATIVE_ARRAY_VOLATILE(V) <-
   // Assume Current is a valid NATIVE_ARRAY_VOLATILE in range
   // [0 .. `old_nb_elts'-1]. Allocate a bigger new array in
diff --git a/src/external/put_to.li b/src/external/put_to.li
index 37c6476..4c1d6e6 100644
--- a/src/external/put_to.li
+++ b/src/external/put_to.li
@@ -47,10 +47,14 @@ Section Public
 
   - variable:VARIABLE <-
   ( + typ_gen:TYPE_GENERIC;
-    //"Rentré ici".println;
 
     typ_gen ?= receiver.static_type.raw;
     { typ_gen != NULL } -? "Type generic is NULL";
+    (typ_gen = NULL).if {
+      print_runtime_stack;
+      "Lisaac Compiler bug in PUT_TO.variable. Use a debug version of the compiler for more information\n".print;
+      die_with_code 1;
+      };
     typ_gen.native_array_variable
   );
 
@@ -73,6 +77,19 @@ Section Public
     index    := idx;
     value    := v;
     //
+    (variable = NULL).if {
+      "at ".print;
+      position.put_error warning text "put to error in put_to";
+      position.put_position;
+      position.send_error;
+      "Receiver : ".print; receiver.debug_display;
+      "Index : ".print;index.debug_display;
+      "Value : ".print;value.debug_display;
+
+      print_runtime_stack;
+      "Lisaac Compiler bug in PUT_TO.make. Use a debug version of the compiler for more information\n".print;
+      die_with_code 1;
+      };
     variable.add_write Self;
   );
 
diff --git a/src/item/itm_external.li b/src/item/itm_external.li
index 6c05a59..57ff934 100644
--- a/src/item/itm_external.li
+++ b/src/item/itm_external.li
@@ -62,6 +62,8 @@ Section Public
     + exp1,exp2,exp3:EXPR;
     + left,right:EXPR;
     + type:TYPE_FULL;
+    + tmpstr : STRING;
+
 
     extern.is_integer.if {
       num := extern.to_integer;
@@ -267,4 +269,4 @@ Section Private
         NODE.new_block position receiver rec with args
       );
     };
-  );
\ No newline at end of file
+  );
diff --git a/src/type/type_generic.li b/src/type/type_generic.li
index 5469c3e..4b486ff 100644
--- a/src/type/type_generic.li
+++ b/src/type/type_generic.li
@@ -234,7 +234,14 @@ Section Public
     string_tmp.replace_all ' ' with '_';
     string_tmp.replace_all '.' with '_';
     intern_name := ALIAS_STR.get_intern string_tmp;
-    (itm_typ.name = ALIAS_STR.prototype_native_array).if {
+   // "[debug Put_to error on native_array] Nom du type : '".print;itm_typ.name.print;"'\n".print; // BUG
+    (
+      (itm_typ.name = ALIAS_STR.prototype_native_array) ||
+      {itm_typ.name = ALIAS_STR.prototype_native_array_volatile} 
+    ).if {
+    /*   proto.position.put_error warning text "put to error in type_generic ; Affectation variable native_array_variable ";
+      proto.position.put_position;
+      proto.position.send_error;*/ // BUG tracking
       native_array_variable := VARIABLE.create (proto.position) name intern_name type (gen.first);
       paper_list.add_last Self;
     };

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list