Ejemplo n.º 1
0
 @Override
 public long determineAddendValue() {
   final INaviOperandTreeNode sibling =
       Preconditions.checkNotNull(
           determineAddendSibling(this), "Error: operand expression is not a two component sum.");
   // TODO(jannewger): there should be a sane way to determine the architecture of an instruction
   // (e.g. via an enum).
   if (sibling.getOperand().getInstruction().getArchitecture().equalsIgnoreCase("x86-64")) {
     return new BigInteger(sibling.getValue()).longValue();
   }
   // If the default assumption of a 32-bit architecture doesn't hold we'll get an exception here.
   // However, since the architecture might be unknown anyway we have no better way than to fail
   // here.
   return (int) Long.parseLong(sibling.getValue());
 }