Making repo public * Add licensing details for limbo directory Create readme.md for disvm-exec project Fix code analysis violations/warnings * Update version to 'beta' - public release
Showing the changes to src/vm/math/Mathmod.cpp (1 of 8 files). Show all
Unified · Split
| @@ -598,7 +598,7 @@ Math_realbits32(vm_registers_t &r, vm_t &vm) · 597 unmodified lines | |||
| 598 | auto &fp = r.stack.peek_frame()->base<F_Math_realbits32>(); | 598 | auto &fp = r.stack.peek_frame()->base<F_Math_realbits32>(); |
| 599 | 599 | ||
| 600 | auto x = static_cast<float>(fp.x); | 600 | auto x = static_cast<float>(fp.x); |
| 601 | uint32_t t; | 601 | word_t t; |
| 602 | std::memcpy(&t, &x, sizeof(x)); | 602 | std::memcpy(&t, &x, sizeof(x)); |
| 603 | 603 | ||
| 604 | *fp.ret = t; | 604 | *fp.ret = t; |
| @@ -610,7 +610,7 @@ Math_realbits64(vm_registers_t &r, vm_t &vm) · 5 unmodified lines | |||
| 610 | auto &fp = r.stack.peek_frame()->base<F_Math_realbits64>(); | 610 | auto &fp = r.stack.peek_frame()->base<F_Math_realbits64>(); |
| 611 | 611 | ||
| 612 | auto x = fp.x; | 612 | auto x = fp.x; |
| 613 | uint64_t t; | 613 | big_t t; |
| 614 | std::memcpy(&t, &x, sizeof(x)); | 614 | std::memcpy(&t, &x, sizeof(x)); |
| 615 | static_assert(sizeof(t) == sizeof(x), "Real should be 64-bits"); | 615 | static_assert(sizeof(t) == sizeof(x), "Real should be 64-bits"); |
| 616 | 616 | ||