Fri 02 Dec 2011 10:30:48 AM UTC, original submission:
The following is an example of a structure that behaves badly when it has an empty cell within.
This submission will be a list of examples of this behavior, ending with one that causes a crash. The problem in all cases is that this particular structure does not behave as other structures.
Example 1
The structure has more fieldnames than fields:
Example 2
Interpretation terminates once the empty cell is encountered.
Example 3
Any member can be extracted from the structure without errors, but the result is undefined even for 'val.name' which should be an empty cell.
Normally you would get these errors
Example 4
From within an OCT-file, the underlying octave_value of this structure can not be extracted and causes a segmentation fault with core dump.
This crash can be avoided by checking the size of
... but the Octave Manual does not mention this, and I doubt many of us have implemented that check.
|