(vm *virtualMachine, op int)
| 370 | } |
| 371 | |
| 372 | func doNumCompare(vm *virtualMachine, op int) error { |
| 373 | err := vm.applyCost(2) |
| 374 | if err != nil { |
| 375 | return err |
| 376 | } |
| 377 | y, err := vm.popInt64(true) |
| 378 | if err != nil { |
| 379 | return err |
| 380 | } |
| 381 | x, err := vm.popInt64(true) |
| 382 | if err != nil { |
| 383 | return err |
| 384 | } |
| 385 | var res bool |
| 386 | switch op { |
| 387 | case cmpLess: |
| 388 | res = x < y |
| 389 | case cmpLessEqual: |
| 390 | res = x <= y |
| 391 | case cmpGreater: |
| 392 | res = x > y |
| 393 | case cmpGreaterEqual: |
| 394 | res = x >= y |
| 395 | case cmpEqual: |
| 396 | res = x == y |
| 397 | case cmpNotEqual: |
| 398 | res = x != y |
| 399 | } |
| 400 | return vm.pushBool(res, true) |
| 401 | } |
| 402 | |
| 403 | func opMin(vm *virtualMachine) error { |
| 404 | err := vm.applyCost(2) |
no test coverage detected