-
Notifications
You must be signed in to change notification settings - Fork 478
Description
cchkhb2stg.f contains a number of calls to DLASET, in the form:
CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 )
CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 )
These calls are wrong, for three reasons:
-
SD and SE are REAL variables of the default kind, while DLASET expects a DOUBLE PRECISION real kind. There is no guarantee that the underlying binary representation of zero is the same for both types, or how DLASET would interpret default real-kind ZERO, when it expects a DOUBLE PRECISION value.
-
The calling routine expects SD and SE to be (N) REAL elements in size. It is quite likely that DLASET will initialize more than the expected size, corrupting something else.
-
The LDA argument to DLASET (1) is potentially less than N, and can trigger a bounds violation in DLASET.
One might be tempted to replace the calls with:
CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, N )
CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, N )
... however, I have no clue whether this is what the author of the code really intended.