mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2098] external compiler gets order of operations wrong #1406
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1406
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @crioux on GitHub (Mar 25, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2098
Constructions of the form
with an increment on the left hand side of an assignment, cause the increment to happen at the wrong time.
I'm not sure if the post-increment is happening as a pre-increment, or if the increment is happening on the 'right hand' side of the assignment, but I get different results if i change that line to
@jfoug commented on GitHub (Mar 25, 2016):
This is similar to the classic "undefined" double modify sequence point problem. The true classic is:
x++ = x;
If you are coding
a[b++] = c[b];then stop doing that. If others have (and we have that code in john's conf files), then please point it out, so we can change it to be defined.Modifying a L-value twice within a single 'sequence' point is by definition UNDEFINED. That means it can be anything the compiler writer wants it to be. So listing that the increment is happening at the wrong time, is itself an invalid statement. In the code you list
a[b++] = c[b];it is a little more 'subtle' that it is undefined, but its undefined none the less. All that you are assured of, is that the a element will be the right one, and that b will not be modified until the proper a has be SELECTED. There is nothing defined listing what the value of b should be when accessing the 'c' data.Jim.
@crioux commented on GitHub (Mar 25, 2016):
Fair enough. Closing this, might be worth a line in the documentation, but no more than that then.
Cheers.