Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 01a0ea175161
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 662b4318a810
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Mar 14, 2016

  1. Copy the full SHA
    31044af View commit details
  2. Copy the full SHA
    185e3b5 View commit details
  3. Copy the full SHA
    662b431 View commit details
Showing with 19 additions and 12 deletions.
  1. +1 −0 .travis.yml
  2. +15 −12 machine/builtin/block_environment.cpp
  3. +3 −0 spec/ruby/optional/capi/time_spec.rb
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ notifications:
on_start: always
env:
global:
- RBXOPT=-Xint
- LANG="en_US.UTF-8"
- secure: olbok/GN6rOYvPnHBYWGz7giCoCdLFpT/7WSBHukYO3E0uNeqAUOOgW2BFOwCVWdSEJ/iTvJXZQ4qVZHX+6jRfvILZeGv+D2P93VdD8UFQRoTOfFC7esAo525s9fuKm9ehUGWZxlzGOBHHckky1jn6pEf8mlXAVM5e76dlH0fck=
- secure: aqG9eB/PrzQ7XJQN6YX/00sNVvwSB77saxXQzguL2WFjAXB74h6168Hzq+awHtNX/vfOb6ta7fpWLHrA0D+gmZnvTR29VlP6nd0vs1tkdX1/jWbiBHjamRffp+NWVdKbJKYn5iLOGXcuUMOzY/opLKOdvxKZfkxGMxR2tTNLZUE=
27 changes: 15 additions & 12 deletions machine/builtin/block_environment.cpp
Original file line number Diff line number Diff line change
@@ -613,21 +613,24 @@ namespace rubinius {
}

Object* BlockEnvironment::of_sender(STATE) {
if(CallFrame* frame = state->vm()->get_ruby_frame(1)) {
if(NativeMethodFrame* nmf = frame->native_method_frame()) {
return state->vm()->native_method_environment->get_object(nmf->block());
}
if(NativeMethodFrame* nmf = state->vm()->get_call_frame(1)->native_method_frame()) {
return state->vm()->native_method_environment->get_object(nmf->block());
}

// TODO: What?
// We assume that code using this is going to use it over and
// over again (ie Proc.new) so we mark the method as not
// inlinable so that this works even with the JIT on.
CallFrame* frame = state->vm()->get_ruby_frame(1);

frame->compiled_code->machine_code()->set_no_inline();
// We assume that code using this is going to use it over and
// over again (ie Proc.new) so we mark the method as not
// inlinable so that this works even with the JIT on.

if(frame->scope) {
return frame->scope->block();
}
if(!frame) {
return cNil;
}

frame->compiled_code->machine_code()->set_no_inline();

if(frame->scope) {
return frame->scope->block();
}

return cNil;
3 changes: 3 additions & 0 deletions spec/ruby/optional/capi/time_spec.rb
Original file line number Diff line number Diff line change
@@ -274,7 +274,10 @@

it "returns time object in localtime if offset given equals INT_MAX" do
@s.rb_time_timespec_new(1447087832, 476451125, 0x7fffffff).should == Time.at(1447087832, 476451.125).localtime
quarantine! do
# Day light savings dependent
@s.rb_time_timespec_new(1447087832, 476451125, 0x7fffffff).gmtoff.should == Time.now.gmtoff
end
end

it "raises an ArgumentError if offset passed is not within range of -86400 and 86400 (exclusive)" do