MCPcopy Create free account
hub / github.com/GraxCode/zelixkiller / invertValue

Method invertValue

src/me/lpk/analysis/StackHelper.java:462–488  ·  view source on GitHub ↗
(AbstractInsnNode insn, InsnValue value)

Source from the content-addressed store, hash-verified

460 }
461
462 public InsnValue invertValue(AbstractInsnNode insn, InsnValue value) {
463 Object obj = value.getValue();
464 switch (insn.getOpcode()) {
465 case Opcodes.INEG:
466 if (obj == null) {
467 return InsnValue.INT_VALUE;
468 }
469 return InsnValue.intValue(-1 * (int) obj);
470 case Opcodes.LNEG:
471 if (obj == null) {
472 return InsnValue.LONG_VALUE;
473 }
474 return InsnValue.longValue(-1L * (long) obj);
475 case Opcodes.FNEG:
476 if (obj == null) {
477 return InsnValue.FLOAT_VALUE;
478 }
479 return InsnValue.floatValue(-1F * (float) obj);
480 case Opcodes.DNEG:
481 if (obj == null) {
482 return InsnValue.DOUBLE_VALUE;
483 }
484 return InsnValue.doubleValue(-1D * (double) obj);
485 }
486
487 return null;
488 }
489
490 public InsnValue getStatic(FieldInsnNode fin) {
491 return new InsnValue(Type.getType(fin.desc));

Callers 1

executeMethod · 0.80

Calls 5

intValueMethod · 0.95
longValueMethod · 0.95
floatValueMethod · 0.95
doubleValueMethod · 0.95
getValueMethod · 0.45

Tested by

no test coverage detected