Skip to content

Fixed pruning mozyme bond order matrix in subroutine mopac_record - solves an array overflow#318

Open
Honza-R wants to merge 2 commits into
openmopac:mainfrom
Honza-R:api_bond_order_overflow_fix
Open

Fixed pruning mozyme bond order matrix in subroutine mopac_record - solves an array overflow#318
Honza-R wants to merge 2 commits into
openmopac:mainfrom
Honza-R:api_bond_order_overflow_fix

Conversation

@Honza-R

@Honza-R Honza-R commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

The code was writing beyond the end of the bond_order array in the mozyme part of the mopac_record routine. This is caused by a mismatch between the 1st pass and 2nd pass loops. I suppose the 1st pass is correct, while the 2nd pass was writing the (i|i) term multiple times as it was in the loop over j. I reworked the 2nd pass loop to match pass 1, and it solved the issue.

Status

  • Ready for merge

…ass 2 loop was modified to match pass 1 in order to prevent writting beyond the end of the bond_order array
@nbehrnd

nbehrnd commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@Honza-R Note, as by commit c6eb1e6, your PR accidentally introduces trailing white space. It is just after then.

The observation was possible thanks to vim amended by vim-better-whitespace; the editor's status line provided the note:

note

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants