-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parser: do not bounds-check arrays of size 0 or 1
This is both a pretty useless degenerate check to carry out, and breaks when -fstrict-flex-arrays is used (whereupon trailing old-style flexible arrays gain bounds of 0). It is almost certainly wrong to use trailing zero-size arrays and -fstrict-flex-arrays in conjunction, but since C doesn't bounds-check this is commonplace. In particular the Linux kernel has turned this on *before* transitioning away from such arrays, rather than afterwards. Fixes system translators (in particular the pr_pgid and pr_sid members of psinfo_t) in conjunction with Linux 6.5+. Signed-off-by: Nick Alcock <nick.alcock@oracle.com> Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
- Loading branch information
1 parent
79719f6
commit c7d7314
Showing
2 changed files
with
33 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Oracle Linux DTrace. | ||
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. | ||
* Licensed under the Universal Permissive License v 1.0 as shown at | ||
* http://oss.oracle.com/licenses/upl. | ||
*/ | ||
|
||
/* | ||
* ASSERTION: | ||
* Array accesses work for CTF-declared arrays of dynamic size. | ||
* pr_pgid is one such. | ||
* | ||
* SECTION: Pointers and Arrays/Array Declarations and Storage | ||
*/ | ||
|
||
BEGIN | ||
{ | ||
trace(curpsinfo->pr_pgid); | ||
exit(0); | ||
} |