AWLF catenate() unit test gives wrong answers
|
|
Bugzilla Link |
1082 |
Created on |
May 15, 2013 14:35 |
Resolution |
FIXED |
Resolved on |
May 15, 2013 19:40 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Attachments |
bug1082.sac |
Extended Description
sac2c -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 18145 linux-gnu_x86_64
(Wed May 15 09:23:39 EDT 2013 by sac)
The attached unit test, if compiled this way:
sac2c bugtuesday.sac -doawlf -nowlf -DBROKEN
produces incorrect answers.
The culprit appears to be CF, in particular,
SCCFprf_idx_modarray_AxSxS and its friends in the
indexed-assign business.
We start with an N_array of N_num (or equivalent):
arr = [ 1, 2];
and are doing:
arr[1] = flatid;
The code then replaces one element of arr by an N_id, producing a
mongrel that is partially flattened:
arr = [ 1, flatid];
This appears to bring on the fault. So, the actual
problem, I think, lies elsewhere, in code that is unable
to tolerate mongrels.