Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VM] Fix potential undefined behavior (#87119)
Use pointer arithmetic instead of direct array access to avoid compilers, specifically GCC, to discover undefined behavior and generate unintended code when optimization is turned on. The array involved is `pSeries->val_serie`, which is declared as a fixed sized array of size 1. However, `index` is always a non-negative integer, and we want to access the memory at `-index`, which is either zero or negative.
- Loading branch information
1 parent
c236ec0
commit 1a1b1f8
Showing
4 changed files
with
24 additions
and
21 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
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