runtime pointer error when invoking print on an array which is the return value of a function
|
|
| Bugzilla Link |
328 |
| Created on |
Nov 23, 2006 16:33 |
| Resolution |
INVALID |
| Resolved on |
May 08, 2007 11:44 |
| Version |
1.00beta |
| OS |
Linux |
| Architecture |
PC |
Extended Description
In the following code example, the print statement will result in a runtime
error similar to
"*** glibc detected *** free(): invalid pointer: 0x080540d0 ***".
use StdIO: all;
import Array: all;
int[*] foo(int[.] shp) {
return(genarray(shp,0));
}
int main() {
shp = [64,64];
A = foo(shp);
print(A[[2,2]]);
return(0);
}