From 1291cfa473e7b6d2bb0696da4c3ecb8603b7905f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Fri, 10 Oct 2014 17:46:35 +0200 Subject: [PATCH] Add test for -[ImmediateRef copy] and document. --- NEWS | 2 ++ test/test/spec/immediateref_spec.rb | 7 ++++++- vm | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 254cd5cd..07d5ee87 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ * Added ARM64 support (64-bit) for iOS. It is not yet enabled by default, in order to do so, add the following line to your project's Rakefile: app.archs['iPhoneOS'] |= ['arm64'] + * Fixed a bug when copying an `ImmediateRef', which isn't needed anyways, + because a tagged pointer can not be duplicated either. * [Vendor] Fixed a bug where Xcode 6 would cache precompiled headers in a hidden location and subsequent builds could fail after cleaning. * [Vendor] Fixed a bug where a failed build could cause subsequent builds to diff --git a/test/test/spec/immediateref_spec.rb b/test/test/spec/immediateref_spec.rb index 176d3249..20783be9 100644 --- a/test/test/spec/immediateref_spec.rb +++ b/test/test/spec/immediateref_spec.rb @@ -31,7 +31,7 @@ describe "ImmediateRef" do ref.ruby_instance_method.should.eql ref end - it "is able to dispatch methods to itself", :unless => bits == 64 do + it "is able to dispatch methods to itself", :if => bits == 64 do class NSIndexPath def ruby_instance_method self.indexAtPosition(0) @@ -40,4 +40,9 @@ describe "ImmediateRef" do ref = NSIndexPath.indexPathWithIndex(42) ref.ruby_instance_method.should == 42 end + + it "does not actually create a copy, but instead returns itself", :if => bits == 64 do + ref = NSIndexPath.indexPathWithIndex(42) + ref.object_id.should == ref.copy.object_id + end end diff --git a/vm b/vm index d945423d..dc03f642 160000 --- a/vm +++ b/vm @@ -1 +1 @@ -Subproject commit d945423d8f1fdd461a4749ae3dccf0d6c7a0a02b +Subproject commit dc03f642528bd3a18778db78c1d9e1519a3cbb3f