Skip to content

Commit

Permalink
AURORA: Create copies in ASBuffer::actionGreater()
Browse files Browse the repository at this point in the history
Popping the stack potentially invalidates the references to the top,
so we need to copy the variable before popping.

This fixes Coverity Scan issue #1403729.
  • Loading branch information
DrMcCoy committed Jul 27, 2019
1 parent 24a46d2 commit 8f75bc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/aurora/actionscript/asbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,9 @@ void ASBuffer::actionEnumerate2() {
}

void ASBuffer::actionGreater() {
const Variable &a = _stack.top();
const Variable a = _stack.top();
_stack.pop();
const Variable &b = _stack.top();
const Variable b = _stack.top();
_stack.pop();

_stack.push(a < b);
Expand Down

0 comments on commit 8f75bc1

Please sign in to comment.