First nested array bug: modarray does not work on nested arrays
|
|
Bugzilla Link |
1025 |
Created on |
Oct 01, 2012 21:05 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Extended Description
sac2c -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 18236:MODIFIED linux-gnu_x86_64
(Mon Oct 1 11:57:46 EDT 2012 by sac)
This simple example of nested array code fails, due to TC not
liking non-simple array arguments:
cat crud2.sac
/*
* Simple example of nested array use in sac2c:
* Construct (iota(3), iota(4), iota(5)...).
*
*/
use Array:all;
nested int[.] vec;
int main()
{
hole = enclose_vec ( [42] );
x = 3 + iota(10);
z = [ hole, hole, hole, hole, hole, hole, hole, hole, hole, hole];
for( i=0; i<20; i++ ) {
z = _modarray_AxVxS_( z, [i], enclose_vec( iota( x[i])));
}
StdIO::print(z);
return(0);
}
The problem is that NTCCTprf_modarray_AxVxS calls TEassureSameSimpleType,
which wants, oddly enough, a SimpleType. Which z is not.
Question for Dr. TC: Can we simply relax that test (handwave, handwave)
to a make it a call to the (non-existent) TCassureSameType?
Or is the pit deeper than that?