[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
kcl-sfasl-bug
In akcl's sfasl.c there is a line which causes problems on the HP-UX C
compiler. In "add_symbol" there is an "if" which checks whether the symbol
table has enough space left for inserting new entries or not. The check
looks like this:
if((c_table.alloc_length) - (c_table.length) - nstr > 0)
Now the alloc_length and length are declared as UNSIGNED while nstr is
a SIGNED integer. HP-UX thought that the result is also UNSIGNED, that is
never negative, which lead to nice core dumps.
I think the bug can be fixed by coercing the first to difference to a
signed integer.
--Gabor Karsai
Dept of EE
Vanderbilt University