From f2e937f1cb43d15ad570338b3b1fe3faa7260ff9 Mon Sep 17 00:00:00 2001 From: "ted.mielczarek" Date: Tue, 21 Feb 2012 23:15:30 +0000 Subject: 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 --- src/processor/postfix_evaluator-inl.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/processor/postfix_evaluator-inl.h') 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::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::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::EvaluateInternal( case BINARY_OP_DIVIDE_MODULUS: result = operand1 % operand2; break; + case BINARY_OP_ALIGN: + result = + operand1 & (reinterpret_cast(-1) ^ (operand2 - 1)); + break; case BINARY_OP_NONE: // This will not happen, but compilers will want a default or // BINARY_OP_NONE case. -- cgit v1.2.1