diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2017-05-08 21:30:17 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2017-05-15 21:16:22 +0200 |
| commit | 09f7c519d4c3249736a16ce36be9b6c3f135d6a8 (patch) | |
| tree | 2bf0fbea0df54d1ef9d0aba3521563367dc4017c /miasm2/jitter/vm_mngr.h | |
| parent | 3260f7867827195ea7c6ec37bc3a8687ce998f6d (diff) | |
| download | miasm-09f7c519d4c3249736a16ce36be9b6c3f135d6a8.tar.gz miasm-09f7c519d4c3249736a16ce36be9b6c3f135d6a8.zip | |
IR: explicit exception for div
Diffstat (limited to '')
| -rw-r--r-- | miasm2/jitter/vm_mngr.h | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/miasm2/jitter/vm_mngr.h b/miasm2/jitter/vm_mngr.h index 912b105e..74ad49ad 100644 --- a/miasm2/jitter/vm_mngr.h +++ b/miasm2/jitter/vm_mngr.h @@ -224,55 +224,55 @@ unsigned int rcr_rez_op(unsigned int size, unsigned int a, unsigned int b, unsig #define UDIV(sizeA) \ - uint ## sizeA ## _t udiv ## sizeA (vm_cpu_t* vmcpu, uint ## sizeA ## _t a, uint ## sizeA ## _t b) \ - { \ - uint ## sizeA ## _t r; \ - if (b == 0) { \ - vmcpu->exception_flags |= EXCEPT_INT_DIV_BY_ZERO; \ - return 0; \ - } \ - r = a/b; \ - return r; \ - } + uint ## sizeA ## _t udiv ## sizeA (vm_cpu_t* vmcpu, uint ## sizeA ## _t a, uint ## sizeA ## _t b) \ + { \ + uint ## sizeA ## _t r; \ + if (b == 0) { \ + fprintf(stderr, "Should not happen\n"); \ + exit(0); \ + } \ + r = a/b; \ + return r; \ + } #define UMOD(sizeA) \ - uint ## sizeA ## _t umod ## sizeA (vm_cpu_t* vmcpu, uint ## sizeA ## _t a, uint ## sizeA ## _t b) \ - { \ - uint ## sizeA ## _t r; \ - if (b == 0) { \ - vmcpu->exception_flags |= EXCEPT_INT_DIV_BY_ZERO; \ - return 0; \ - } \ - r = a%b; \ - return r; \ - } + uint ## sizeA ## _t umod ## sizeA (vm_cpu_t* vmcpu, uint ## sizeA ## _t a, uint ## sizeA ## _t b) \ + { \ + uint ## sizeA ## _t r; \ + if (b == 0) { \ + fprintf(stderr, "Should not happen\n"); \ + exit(0); \ + } \ + r = a%b; \ + return r; \ + } #define IDIV(sizeA) \ - int ## sizeA ## _t idiv ## sizeA (vm_cpu_t* vmcpu, int ## sizeA ## _t a, int ## sizeA ## _t b) \ - { \ - int ## sizeA ## _t r; \ - if (b == 0) { \ - vmcpu->exception_flags |= EXCEPT_INT_DIV_BY_ZERO; \ - return 0; \ - } \ - r = a/b; \ - return r; \ - } + int ## sizeA ## _t idiv ## sizeA (vm_cpu_t* vmcpu, int ## sizeA ## _t a, int ## sizeA ## _t b) \ + { \ + int ## sizeA ## _t r; \ + if (b == 0) { \ + fprintf(stderr, "Should not happen\n"); \ + exit(0); \ + } \ + r = a/b; \ + return r; \ + } #define IMOD(sizeA) \ - int ## sizeA ## _t imod ## sizeA (vm_cpu_t* vmcpu, int ## sizeA ## _t a, int ## sizeA ## _t b) \ - { \ - int ## sizeA ## _t r; \ - if (b == 0) { \ - vmcpu->exception_flags |= EXCEPT_INT_DIV_BY_ZERO; \ - return 0; \ - } \ - r = a%b; \ - return r; \ - } + int ## sizeA ## _t imod ## sizeA (vm_cpu_t* vmcpu, int ## sizeA ## _t a, int ## sizeA ## _t b) \ + { \ + int ## sizeA ## _t r; \ + if (b == 0) { \ + fprintf(stderr, "Should not happen\n"); \ + exit(0); \ + } \ + r = a%b; \ + return r; \ + } void memory_access_list_init(struct memory_access_list * access); |