Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VM] Fix potential undefined behavior #87119

Merged
merged 1 commit into from
Jun 7, 2023

Commits on Jun 6, 2023

  1. [VM] Fix potential undefined behavior

    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.
    trungnt2910 committed Jun 6, 2023
    Configuration menu
    Copy the full SHA
    58005e4 View commit details
    Browse the repository at this point in the history