disassembler: don't force precision for dumpDouble#59
disassembler: don't force precision for dumpDouble#59Mythie wants to merge 1 commit intoCyberShadow:masterfrom
Conversation
Forcing precision would cause the parsing MAX_DOUBLE to fail which would result in the `.asasm` output being blank, disabling the forced precision allows it to continue without any regressions as far as I can tell.
|
Yes, unfortunately just import std.stdio;
void main()
{
double N = 0x123456789ABCDp0;
writefln("%g", N);
writefln("%.18g", N);
}Output: Using
It doesn't fail here. I am testing with |
|
Yep so that's the one I'm having an issue on, running Exception seems to be thrown when we force the value we've written to the buffer back to a double for comparison: I say seem's as I'm on Apple Silicon and thus have to use |
|
Yes, that definitely sounds like something ARM-specific. |
Where is this coming from? There is no |
These are the
I recall having this issue on an x64 machine as well using |
|
Okay, got it.
One way to test that theory would be to try it in a C program: #include <stdio.h>
int main()
{
double v = 0;
int res = sscanf("1.79769313486231571e+308", "%lf", &v);
printf("Scanned %d values (%a)\n", res, v);
return 0;
}For me this prints |
|
Can confirm the same happens with Clang and GCC on Apple Silicon: Compiled with: |
|
I encountered an swf which had errors disassembling, had to use this pr to get most of the abcs to disassemble on my x86 linux system. |
Forcing precision would cause the parsing MAX_DOUBLE to fail which would result in the
.asasmoutput being blank, disabling the forced precision allows it to continue without any regressions as far as I can tell.