Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

guard 1.8-specific vm test #1558

Closed
wants to merge 1 commit into from

3 participants

@ryoqun
Collaborator

Afrer rubinius is configure'd with --default-version=19, rake'ing is interrupted in middle of vm:test by SEGV.

A commit (07859e4 Don't use alias chains to implement {Fixnum,Bignum}#** returning Rational in 1.9) introduced 1.8 specific behaviour in Fixnum::pow. But, an affected vm test hasn't been updated. This commit does the missed update to the vm test.

The cause of SEGV is like this:

Since that comimt, Fixnum::pow became to return Primitives::failure in a corner case in 1.9 mode. Primitives::failure is just a special integer constant reinterpret_casted into Object *. So, in general it shouldn't be dereferenced. Yet, the vm test tries to do anyway and SEGVes.

@dbussink
Owner

It's probably best to remove this test completely. Behavior like this is covered in Rubyspec and these tests are to assert really basic VM behavior.

@brixen brixen closed this in ccaa717
@ryoqun
Collaborator

I think your solution is better than me. :) Thank you! Now, I can happily hack rubinius with default version as 1.9! Hehe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 14, 2012
  1. @ryoqun

    guard 1.8-specific vm test

    ryoqun authored
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 vm/test/test_fixnum.hpp
View
8 vm/test/test_fixnum.hpp
@@ -315,8 +315,12 @@ class TestFixnum : public CxxTest::TestSuite, public VMTest {
TS_ASSERT_EQUALS(Fixnum::from(-1)->pow(state, Fixnum::from(1)), Fixnum::from(-1));
TS_ASSERT_EQUALS(Fixnum::from(-1)->pow(state, Fixnum::from(2)), Fixnum::from(1));
TS_ASSERT_EQUALS(Fixnum::from(7)->pow(state, Fixnum::from(5)), Fixnum::from(16807));
- check_float(as<Float>(Fixnum::from(100)->pow(state, Fixnum::from(-1))),
- Float::create(state,.01));
+ if(LANGUAGE_18_ENABLED(state)) {
+ check_float(as<Float>(Fixnum::from(100)->pow(state, Fixnum::from(-1))),
+ Float::create(state,.01));
+ } else {
+ TS_ASSERT_EQUALS(Fixnum::from(100)->pow(state, Fixnum::from(-1)), Primitives::failure());
+ }
}
void test_pow_overflows_to_bignum() {
Something went wrong with that request. Please try again.