diff options
author | Julian Brown <julian@codesourcery.com> | 2006-09-05 14:24:01 +0000 |
---|---|---|
committer | Julian Brown <julian@codesourcery.com> | 2006-09-05 14:24:01 +0000 |
commit | 34ff8c34afe285692b860f2b2c762fdc8e1c1d45 (patch) | |
tree | 236cb9dfbd2d7361a808ee2ac11dd2762049f691 | |
parent | c8b6b78b96b67cdcd53774da54ef8796d990e6ea (diff) | |
download | binutils-redhat-34ff8c34afe285692b860f2b2c762fdc8e1c1d45.tar.gz |
gas/
* config/tc-arm.c (parse_qfloat_immediate): Disallow integer syntax for
floating-point immediates.
-rw-r--r-- | ChangeLog.csl | 6 | ||||
-rw-r--r-- | gas/config/tc-arm.c | 23 |
2 files changed, 29 insertions, 0 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl index e36028c538..7d820e1dbc 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -1,3 +1,9 @@ +2006-09-05 Julian Brown <julian@codesourcery.com> + + gas/ + * config/tc-arm.c (parse_qfloat_immediate): Disallow integer syntax for + floating-point immediates. + 2006-09-04 Paul Brook <paul@codesourcery.com> gas/ diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 6b5871af76..bebbbab61c 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; |