[Aldor-l] Code audit

Pippijn van Steenhoven pip88nl at gmail.com
Tue Jun 24 16:32:54 EDT 2008


Hello Aldor List,

while reading, modifying and testing bits and pieces of the compiler,
I came across many potentially unsafe fragments. These fragments
include unsigned/signed comparisons, truncating assignments, unchecked
integer overflow, etc. Things like that. Generally, these should not
be problematic, but using an int as loop variable where the loop
condition compares with Length is both non-descriptive and wrong on
certain platforms. Where on 32 bit architectures, int and Length are
probably equally sized, on 64 bit machines that use the LP64 data
model (for instance gcc on linux/x86_64), Length is larger than int
and therefore, the loop variable may not be able to loop through each
element, causing infinite loops.

I suggest a thorough audit of the code, pointing out each arguable
comparison, assignment, etc. There are several occasions where the
modification required is straightforward, but many are not as clear
and require deep knowledge of the code. Deep, by the way, is not just
knowing what the code does, but more importantly, what the code was
supposed to do when it was written. Who is up for some more active
development?

Regards,

-- 
Pippijn van Steenhoven




More information about the Aldor-l mailing list