- Subject: Re: [slang-users] slang 2.3.2 build problem by GCC v8 on Linux/i586
- From: jed@xxxxxxxxxxx (John E. Davis)
- Date: Sun, 7 Apr 2019 15:12:53 -0400
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]