#439 closed defect (fixed)
Segmentation fault with local structs
Reported by: | Jorge | Owned by: | Víctor de Buen Remiro |
---|---|---|---|
Priority: | highest | Milestone: | |
Component: | SetAlgebra | Version: | head |
Severity: | critical | Keywords: | |
Cc: |
Description
Try the following code:
Set s1 = {
Struct strA {
Text tt
};
strA("aa")
};
Set View(s1?, "Std");
A segmentation fault is generated when ejecuting "View", the same happens when doing
Text StructName(s1);
It seems to be related with Struct strA being local. It could be related to other bugs in tolbase/toltcl because when a doing tol::forallchild if an item of a Set is an structured Set the following is executed for that item:
ptrSet->Struct()->Name();
and that expresion will fail if the Struct does not exists, ie. point to an invalid address.
Change History (2)
comment:1 Changed 19 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 18 years ago by
bug_file_loc: | → http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000439 |
---|
Problem has been fixed in CVS and a test is added to
Local structure is not accessible out of scope, so, set created in this way will work as non structured sets. Also, an error like this will be sent to the user: