From: Julian Brown Date: Tue, 5 Sep 2006 14:24:01 +0000 (+0000) Subject: gas/ X-Git-Tag: binutils-csl-sourcerygxx-4_1-18~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a447ca9868608942edf8f965059bbb9f397d40d4;p=thirdparty%2Fbinutils-gdb.git gas/ * config/tc-arm.c (parse_qfloat_immediate): Disallow integer syntax for floating-point immediates. --- diff --git a/ChangeLog.csl b/ChangeLog.csl index e36028c538a..7d820e1dbc7 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -1,3 +1,9 @@ +2006-09-05 Julian Brown + + gas/ + * config/tc-arm.c (parse_qfloat_immediate): Disallow integer syntax for + floating-point immediates. + 2006-09-04 Paul Brook gas/ diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 6b5871af762..bebbbab61ca 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -4121,10 +4121,33 @@ static unsigned parse_qfloat_immediate (char **ccp, int *immed) { char *str = *ccp; + char *fpnum = str; LITTLENUM_TYPE words[MAX_LITTLENUMS]; + int found_fpchar = 0; skip_past_char (&str, '#'); + /* We must not accidentally parse an integer as a floating-point number. Make + sure that the value we parse is not an integer by checking for special + characters '.' or 'e'. + FIXME: This is a horrible hack, but doing better is tricky because type + information isn't in a very usable state at parse time. A better solution + should be implemented as part of the fix for allowing the full range of + pseudo-instructions to be used in VMOV, etc. */ + skip_whitespace (fpnum); + if (strncmp (fpnum, "0x", 2) != 0) + { + for (; *fpnum != '\0' && *fpnum != ' ' && *fpnum != '\n'; fpnum++) + if (*fpnum == '.' || *fpnum == 'e' || *fpnum == 'E') + { + found_fpchar = 1; + break; + } + + if (!found_fpchar) + return FAIL; + } + if ((str = atof_ieee (str, 's', words)) != NULL) { unsigned fpword = 0;