Created attachment 376860 [details] [diff] [review] patch that converts some error() tests to asserts In pageValidate() and resourceConsistencyCheck(), abort on prior error, rather than skipping. This establishes an invariant -- prior error should be impossible due to the calling context.
is this valid for all the possible ways error() can be set? (out of memory, stackfull, etc?)
It's valid. Both functions only have one calling context, which looks like this: if (error()) return; // check that all is well (don't check in exit paths since its more complicated) debug_only( pageValidate(); ) debug_only( resourceConsistencyCheck(); )
I should add the reason for this change. It's because the use of the Assembler._err field, accessed through the error() and setError() methods, is very confusing, and this ties in with the difficulties of OOM handling. Converting these two cases to assertions effectively removed two uses of error(), and so made a small step towards simplifying the error handling.
Comment on attachment 376860 [details] [diff] [review] patch that converts some error() tests to asserts cool