Mark MemVals fails
Bugzilla Link | 537 |
Created on | Jul 30, 2009 19:14 |
Resolution | FIXED |
Resolved on | Aug 09, 2009 17:57 |
Version | 1.00beta |
OS | Linux |
Architecture | PC |
Extended Description
Here is a bugreport: /* * SAC - bug report * ================ * * automatically generated on Thu Jul 30 19:11:14 BST 2009 * * using sac2c v1.00-beta (Buchette d'Anjou) rev 16226 for linux-gnu_i686 * built Fri Jul 24 15:22:58 BST 2009. * by user asv on host obelix for linux-gnu. * * The compiler was called by * sac2c test.sac * * The contents of test.sac is: */ use StdIO: all; use Array: all; int[.], int get_bits(int[.] array, int index, int count) { res = [:int]; status = 0; if (index + count> shape(array)[0]) { status = 1; } else { res = tile([count], [index], array); } return (res, status); } int, int int_from_bits(int[.] array) { res = 0; status = 0; if (shape(array)[0] > 32) { status = 1; } else { print(array); pow = 1; for (j=shape(array)[0]-1; j>=0; j--) { res += (array[j] * pow); /*printf("%u, %u\n", j, array[j] * pow);*/ pow *= 2; } } return (res, status); } int main() { array = FibreScanIntArray(); p, err1 = get_bits(array, 0, 16); x, err2 = int_from_bits(p); return (0); } The program brakes when we do not use "res += (array[j] * pow)" inside of `int_from_bits' function.