I was looking at the inline asm for ms_vsscanf. I noticed a few issues with it.
But more importantly, the code is fundamentally flawed (as described on that same link). It only works for up to ~15 tokens (depending on compile options) before you get stack corruption.
If this is going to use a fixed size buffer (which is sort of what this code is doing now), there are easier ways to do it. It might also make sense to pick a better size.
Unless someone can think of a way to determine the size of the va_list?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, I'm running out of things to fiddle with. But I did find one more: Use .L for the internal label names. Saves 18 bytes off the size of the object file (and probably 0 on the executable).
Note that while I don't speak ARM, I think there are some problems with the ms_vswscanf_internal and related routines (like writing to the stack before adjusting the stack pointer). And having 1 asm routine for all 4 functions (like I'm doing for x86) would sure clean up the code. When it comes to inline asm: Less is better.
After much effort I was able to get mingw-w64 to build for ARM. It turns out there was a bit of a glitch with this patch under those circumstances. See new patch (attached).
thanks for working on this. I don't want to loose here the implementations we have. it might be necessary for different environments to resurrect them ...
So I would suggest to check for existance of those builtin functions, and then - just if they exist - to superset the current implementation.
Regards,
Kai
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was looking at the inline asm for ms_vsscanf. I noticed a few issues with it.
But more importantly, the code is fundamentally flawed (as described on that same link). It only works for up to ~15 tokens (depending on compile options) before you get stack corruption.
If this is going to use a fixed size buffer (which is sort of what this code is doing now), there are easier ways to do it. It might also make sense to pick a better size.
Unless someone can think of a way to determine the size of the va_list?
ktietz, I have created a patch that fixes the issues I have described. Since thunderbird won't let me send it to the list, I'll attach it here.
And as part of my ongoing campaign to rid the world of inline assembly, I have replaced more of it with builtins (attached).
Updated patch for the sscanf stuff.
Well, I'm running out of things to fiddle with. But I did find one more: Use .L for the internal label names. Saves 18 bytes off the size of the object file (and probably 0 on the executable).
Note that while I don't speak ARM, I think there are some problems with the ms_vswscanf_internal and related routines (like writing to the stack before adjusting the stack pointer). And having 1 asm routine for all 4 functions (like I'm doing for x86) would sure clean up the code. When it comes to inline asm: Less is better.
After much effort I was able to get mingw-w64 to build for ARM. It turns out there was a bit of a glitch with this patch under those circumstances. See new patch (attached).
Hi,
thanks for working on this. I don't want to loose here the implementations we have. it might be necessary for different environments to resurrect them ...
So I would suggest to check for existance of those builtin functions, and then - just if they exist - to superset the current implementation.
Regards,
Kai