Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions np1.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ logical vbflag;
const integer r50wal = 36852;

/* System generated locals */
volatile integer ret_val, i__1, i__2;
integer ret_val, i__1, i__2;

/* Local variables */
integer i, j, adj;
Expand Down Expand Up @@ -55,7 +55,7 @@ logical vbflag;
pv_1.p2 = 0;

buzlnt = 20;
prplnt = 48;
prplnt = 45;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked through everything again to confirm that this is the correct fix:

PRPLNT is also defined as 48 in the original Fortran code while PVOC is an array with only 45 entries resulting in out of bounds access.

The issue only turned fatal once optimizations were turned on and the C compiler turned the Undefined Behavior into a reason to do horrible stuff.

dirlnt = 75;
/* SPARSE, PAGE 8 */

Expand Down