mirror of
https://git.savannah.gnu.org/git/gperf.git
synced 2025-12-02 13:09:22 +00:00
Fix a severe code generation bug occurring with option -c.
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
2000-08-19 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
|
||||
|
||||
* src/key-list.cc (Output_Compare_Strncmp::output_comparison):
|
||||
After the call to strncmp, verify that expr2 is not longer than
|
||||
`len'.
|
||||
Reported by Carlo Wood <carlo@runaway.xs4all.nl>.
|
||||
|
||||
* src/key-list.cc (Key_List::output_lookup_function_body): Avoid
|
||||
emitting the loop for dealing with duplicates if
|
||||
total_duplicates == 0.
|
||||
|
||||
@@ -805,7 +805,9 @@ void Output_Compare_Strncmp::output_comparison (const Output_Expr& expr1,
|
||||
expr1.output_expr ();
|
||||
printf (" + 1, ");
|
||||
expr2.output_expr ();
|
||||
printf (" + 1, len - 1)");
|
||||
printf (" + 1, len - 1) && ");
|
||||
expr2.output_expr ();
|
||||
printf ("[len] == '\\0'");
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user