diff --git a/vm/metrics.cpp b/vm/metrics.cpp index a470c1ebe0..6ca91b3b30 100644 --- a/vm/metrics.cpp +++ b/vm/metrics.cpp @@ -391,7 +391,7 @@ namespace rubinius { i != metrics_map_.end(); ++i) { - values->put(state, index, Bignum::from(state, (*i)->second)); + values->put(state, index, Integer::from(state, (*i)->second)); Object* key = reinterpret_cast(state->symbol((*i)->first.c_str())); map->store(state, key, Fixnum::from(index++)); diff --git a/vm/test/test_integer.hpp b/vm/test/test_integer.hpp index 60d561feca..031277f8df 100644 --- a/vm/test/test_integer.hpp +++ b/vm/test/test_integer.hpp @@ -13,6 +13,10 @@ class TestInteger : public CxxTest::TestSuite, public VMTest { destroy(); } + void test_from_zero_yields_fixnum() { + TS_ASSERT(kind_of(Integer::from(state, 0))); + } + void test_kind_of_numeric() { Fixnum* fix = Fixnum::from(13); Bignum* big = Bignum::from(state, (native_int)14);