Skip to content

Commit

Permalink
ruby.h: unnormalized Fixnum value
Browse files Browse the repository at this point in the history
* include/ruby/ruby.h (ST2FIX): fix unnormalized Fixnum value bug
  on mingw/mswin.  [ruby-core:82687] [Bug #13877]

git-svn-id: svn+ssh://svn.ruby-lang.org/ruby/trunk@59765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu authored and mrkn committed Dec 13, 2017
1 parent dd73666 commit 86b5d13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/bigdecimal/bigdecimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ BigDecimal_hash(VALUE self)
hash ^= rb_memhash(p->frac, sizeof(BDIGIT)*p->Prec);
hash += p->exponent;
}
return INT2FIX(hash);
return ST2FIX(hash);
}

/*
Expand Down
6 changes: 6 additions & 0 deletions ext/bigdecimal/bigdecimal.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ rb_sym2str(VALUE sym)
}
#endif

#ifndef ST2FIX
# undef RB_ST2FIX
# define RB_ST2FIX(h) LONG2FIX((long)(h))
# define ST2FIX(h) RB_ST2FIX(h)
#endif

#ifdef vabs
# undef vabs
#endif
Expand Down

0 comments on commit 86b5d13

Please sign in to comment.