aports/main/slang/fix-slarray-32bit.patch
TBK 65a680b299 main/slang: modernize
- Switch url and src to https
- Add -static subpkg
- Patch redundant rpath
- Patch 32bit array issue
2020-04-30 00:09:31 +00:00

20 lines
704 B
Diff

Upstream: no idea. Patch from upstream mailing list.
Reason: src/test/array.sl fails on 32bit archs:
Testing array functions ...Unable to create a multi-dimensional array of the desired size
./array.sl:166:<top-level>:Invalid Parameter
URL: http://lists.jedsoft.org/lists/slang-users/2019/0000002.html
--- a/src/slarray.c
+++ b/src/slarray.c
@@ -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);