Skip to content

Instantly share code, notes, and snippets.

@timothyklim
Forked from henrik/USAGE.md
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timothyklim/11043852 to your computer and use it in GitHub Desktop.
Save timothyklim/11043852 to your computer and use it in GitHub Desktop.
Index: ext/bigdecimal/bigdecimal.c
===================================================================
--- ext/bigdecimal/bigdecimal.c (revision 45014)
+++ ext/bigdecimal/bigdecimal.c (revision 45015)
@@ -2467,9 +2467,11 @@
static VALUE
BigDecimal_initialize(int argc, VALUE *argv, VALUE self)
{
+ ENTER(1);
Real *pv = rb_check_typeddata(self, &BigDecimal_data_type);
- Real *x = BigDecimal_new(argc, argv);
+ Real *x;
+ GUARD_OBJ(x, BigDecimal_new(argc, argv));
if (ToValue(x)) {
pv = VpCopy(pv, x);
}
@@ -2548,7 +2550,10 @@
static VALUE
BigDecimal_global_new(int argc, VALUE *argv, VALUE self)
{
- Real *pv = BigDecimal_new(argc, argv);
+ ENTER(1);
+ Real *pv;
+
+ GUARD_OBJ(pv, BigDecimal_new(argc, argv));
if (ToValue(pv)) pv = VpCopy(NULL, pv);
pv->obj = TypedData_Wrap_Struct(rb_cBigDecimal, &BigDecimal_data_type, pv);
return pv->obj;

Read this rbenv/ruby-build#550 if you're trying to install patch on Mac OS X 10.9 with homebrew

rbenv install -f --patch 2.1.1 < <(curl -sSL https://gist.githubusercontent.com/TimothyKlim/11043852/raw/fe228cf0524873c992fa5c31b1173537dca76a2c/patch.diff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment