Applied in changeset commit:git|ec3b6b12e7fdd9eb833ba867eb862956a85f424b. ---------- [Bug #22284] Fix curry with a non-Fixnum arity on LLP64 FIX2INT does not call to_int where int and long have the same size, so `method(:puts).curry(1r...YO4 (Yoshinao Muramatsu)
FIX2INT does not call to_int where int and long have the same size, so `method(:puts).curry(1r)` waited for a garbage number of arguments on Windows. Convert the arity once and keep the result as a Fixnum, which also limits the to_int ca...YO4 (Yoshinao Muramatsu)
Oddly, when building with msvc (19.44), the linking fails only while disabling optimization (using the /Od option). ``` linking miniruby.exe Creating library miniruby.lib and object miniruby.exp set.obj : error LNK2019: unresolved ext...YO4 (Yoshinao Muramatsu)
Using the option (one of -std:[c11|c17|clatest]) to enable standard C support in msvc causes the following error: [BUG] vm_call_method: unsupported method type (-7) Simply disable it.YO4 (Yoshinao Muramatsu)
msvc supports flexible array as it's language extensions. The /Za msvc compiler option disables this and other extensions, but it is not necessary to consider it. The Windows SDK headers contain anonymous unions/structs, and using /Za ma...YO4 (Yoshinao Muramatsu)
If we want to correct Windows' behavior, the following would be potential patches. ```diff --- a/proc.c +++ b/proc.c @@ -4611,10 +4611,11 @@ proc_curry(int argc, const VALUE *argv, VALUE self) arity = INT2FIX(min_arity); ...YO4 (Yoshinao Muramatsu)
In include/ruby/internal/arithmetic/int.h, FIX2INT is resolved to rb_fix2int or RB_FIX2LONG. ``` #define FIX2INT RB_FIX2INT /**< @old{RB_FIX2INT} */ /** * Converts a Fixnum into C's `int`. * * @param[in] x Some F...YO4 (Yoshinao Muramatsu)
The proc_curry function in proc.c is affected by differences in behavior caused by the int size in FIX2INT. As a result, depending on the arguments, curry may not function correctly on Windows. ``` method(:puts).curry(1r).call(42) =>...YO4 (Yoshinao Muramatsu)