public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] fix typo in attr_fnspec::verify
@ 2021-07-14 1:41 Alexandre Oliva
0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2021-07-14 1:41 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:56f4d98b5db2ee4f82d4aa413662318cf2fff85c
commit 56f4d98b5db2ee4f82d4aa413662318cf2fff85c
Author: Alexandre Oliva <oliva@adacore.com>
Date: Tue Jul 13 22:39:17 2021 -0300
fix typo in attr_fnspec::verify
Odd-numbered indices describing argument access sizes in the fnspec
string can only hold 't' or a digit, as tested in the beginning of the
case. When checking that the size-supplying argument does not have
additional information associated with it, the test that excludes the
't' possibility looks for it at the even position in the fnspec
string. Oops.
This might yield false positives and negatives if a function has a
fnspec in which an argument uses a 't' access-size, and ('t' - '1')
happens to be the index of an argument described in an fnspec string.
Assuming ASCII encoding, it would take a function with at least 68
arguments described in fnspec. Still, probably worth fixing.
for gcc/ChangeLog
* tree-ssa-alias.c (attr_fnspec::verify): Fix index in
non-'t'-sized arg check.
Diff:
---
gcc/tree-ssa-alias.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index ebb3f49c86c..3e578e5d05f 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -3868,7 +3868,7 @@ attr_fnspec::verify ()
&& str[idx] != 'w' && str[idx] != 'W'
&& str[idx] != 'o' && str[idx] != 'O')
err = true;
- if (str[idx] != 't'
+ if (str[idx + 1] != 't'
/* Size specified is scalar, so it should be described
by ". " if specified at all. */
&& (arg_specified_p (str[idx + 1] - '1')
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-14 1:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-14 1:41 [gcc(refs/users/aoliva/heads/testme)] fix typo in attr_fnspec::verify Alexandre Oliva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).