aboutsummaryrefslogtreecommitdiff
path: root/src/processor/postfix_evaluator-inl.h
diff options
context:
space:
mode:
authorted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2012-02-21 23:15:30 +0000
committerted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2012-02-21 23:15:30 +0000
commitf2e937f1cb43d15ad570338b3b1fe3faa7260ff9 (patch)
tree0a3df2184fd7175b7519279fa61c6f7741e76a5c /src/processor/postfix_evaluator-inl.h
parentMove away from the 10.4 SDK. (diff)
downloadbreakpad-f2e937f1cb43d15ad570338b3b1fe3faa7260ff9.tar.xz
Add support for @ operator to PostfixEvaluator
R=mark at http://breakpad.appspot.com/349002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@923 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/postfix_evaluator-inl.h')
-rw-r--r--src/processor/postfix_evaluator-inl.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/processor/postfix_evaluator-inl.h b/src/processor/postfix_evaluator-inl.h
index b24f092c..22faf7b2 100644
--- a/src/processor/postfix_evaluator-inl.h
+++ b/src/processor/postfix_evaluator-inl.h
@@ -83,7 +83,8 @@ bool PostfixEvaluator<ValueType>::EvaluateInternal(
BINARY_OP_SUBTRACT,
BINARY_OP_MULTIPLY,
BINARY_OP_DIVIDE_QUOTIENT,
- BINARY_OP_DIVIDE_MODULUS
+ BINARY_OP_DIVIDE_MODULUS,
+ BINARY_OP_ALIGN
};
BinaryOperation operation = BINARY_OP_NONE;
@@ -97,6 +98,8 @@ bool PostfixEvaluator<ValueType>::EvaluateInternal(
operation = BINARY_OP_DIVIDE_QUOTIENT;
else if (token == "%")
operation = BINARY_OP_DIVIDE_MODULUS;
+ else if (token == "@")
+ operation = BINARY_OP_ALIGN;
if (operation != BINARY_OP_NONE) {
// Get the operands.
@@ -126,6 +129,10 @@ bool PostfixEvaluator<ValueType>::EvaluateInternal(
case BINARY_OP_DIVIDE_MODULUS:
result = operand1 % operand2;
break;
+ case BINARY_OP_ALIGN:
+ result =
+ operand1 & (reinterpret_cast<ValueType>(-1) ^ (operand2 - 1));
+ break;
case BINARY_OP_NONE:
// This will not happen, but compilers will want a default or
// BINARY_OP_NONE case.