-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not cast pointers to arrays of differently sized integers.
Casting between `int64_t *` and `int32_t *` does *not* maintain the values in the array. Instead, it tells the compiler to interpret the memory at that pointer as an array of a different type (i.e., two `int32_t` elements "become" one `int64_t` element). That can lead to all kinds of errors and is very not what was intended. Remove the integer pointer casts to allow the compiler to emit an error on compile-time instead of potentially causing, e.g., an array overflow on runtime if `sunindextype` has a different size from `KLU_INDEXTYPE`. Signed-off-by: Markus Mützel <[email protected]>
- Loading branch information
Showing
1 changed file
with
9 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