mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 20:57:55 +00:00
Only left-shift FieldDescription::io
when io_found == true
The `io` field of `FieldDescription` takes a default value of 15. In `FieldDescription::parseComment`, it may be updated as specified in the comment text. There are 4 possible cases: 1) Neither IO attributes nor checkpoint IO attributes are found in the comment 2) IO attributes are found in the comment, but checkpoint IO attributes are not 3) Checkpoint IO attributes are found in the comment, but IO attributes are not 4) Both IO attributes and checkpoint IO attributes are found in the comment In case 2, the IO attributes are copied into the checkpoint IO attributes by the statement `io |= (io << 2)`. However, this also erroneously runs in case 1, causing the default value of 15 to change to 63. By testing `io_found == true`, this logic occurs only in case 2. Fixes #568
This commit is contained in:
parent
f68950db9f
commit
db07582616
@ -270,7 +270,7 @@ void FieldDescription::parseComment(std::string comment) {
|
||||
if ( chkpnt_io_found == true ) {
|
||||
// If a checkpoint I/O spec is found add it to the io field.
|
||||
io = (chkpnt_io << 2 ) + ( io & 3 ) ;
|
||||
} else {
|
||||
} else if ( io_found == true ) {
|
||||
// else duplicated the io field to the chkpnt io field.
|
||||
io |= (io << 2 ) ;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user