From 3cf67f58ce8e42f9ce8d7be45936eedf79751b46 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 9 Aug 2016 11:33:27 -0400 Subject: If a strnum integer has a non-standard string representation, do not accept it as an integer array subscript. --- awk.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'awk.h') diff --git a/awk.h b/awk.h index 7288e20f..ff622898 100644 --- a/awk.h +++ b/awk.h @@ -420,6 +420,14 @@ typedef struct exp_node { * and add WSTRCUR to the flags so that we don't have to do the * conversion more than once. * + * The NUMINT flag may be used with a value of any type -- NUMBER, + * STRING, or STRNUM. It indicates that the string representation + * equals the result of sprintf("%ld", ). So, for + * example, NUMINT should NOT be set if it's a strnum or string value + * where the string is " 1" or "01" or "+1" or "1.0" or "0.1E1". This + * is a hint to indicate that an integer array optimization may be + * used when this value appears as a subscript. + * * We hope that the rest of the flags are self-explanatory. :-) */ # define STRING 0x0002 /* assigned as string */ -- cgit v1.2.3