slang-users mailing list

[2019 Date Index] [2019 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] slang 2.3.2 build problem by GCC v8 on Linux/i586


Sergey <a_s_y@xxxxxxx> wrote:
> I attempt to build slang 2.3.2 by GCC v8 on Linux/i586. Building is
> fine but some tests isn't passed:
>
> ...
> Testing array functions ...Unable to create a multi-dimensional array of the desired size
> ./array.sl:166:<top-level>:Invalid Parameter
> Testing array functions [UTF-8 mode] ...Unable to create a multi-dimensional array of the desired size
> ./array.sl:166:<top-level>:Invalid Parameter
> ...

It seems like an optimizer bug.  Does this patch to slarray.c help?

--- slarray.c~	2018-03-04 14:25:32.339928982 -0500
+++ slarray.c	2019-04-07 15:07:07.125037903 -0400
@@ -369,7 +369,9 @@
 	SLindex_Type new_num_elements;
 	at->dims[i] = dims[i];
 	new_num_elements = dims[i] * num_elements;
-	if (dims[i] && (new_num_elements/dims[i] != num_elements))
+	if (dims[i]
+	    && ((new_num_elements/dims[i] != num_elements)
+		|| (new_num_elements < 0)))
 	  {
 	     throw_size_error (SL_Index_Error);
 	     free_array (at);

Thanks,
--John
_______________________________________________
For list information, visit <http://jedsoft.org/slang/mailinglists.html>.


[2019 date index] [2019 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]