[前][次][番号順一覧][スレッド一覧]

ruby-changes:73184

From: Kevin <ko1@a...>
Date: Tue, 30 Aug 2022 00:59:53 +0900 (JST)
Subject: [ruby-changes:73184] ac77d151d6 (master): Assert that the # of bytes matches for label refs (https://github.com/Shopify/ruby/pull/316)

https://git.ruby-lang.org/ruby.git/commit/?id=ac77d151d6

From ac77d151d6ef2848a709ff832424fca9cbb66ac6 Mon Sep 17 00:00:00 2001
From: Kevin Newton <kddnewton@g...>
Date: Thu, 14 Jul 2022 10:35:09 -0400
Subject: Assert that the # of bytes matches for label refs
 (https://github.com/Shopify/ruby/pull/316)

---
 yjit/src/asm/mod.rs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/yjit/src/asm/mod.rs b/yjit/src/asm/mod.rs
index 2fc75083e4..0e05eb5783 100644
--- a/yjit/src/asm/mod.rs
+++ b/yjit/src/asm/mod.rs
@@ -252,6 +252,10 @@ impl CodeBlock { https://github.com/ruby/ruby/blob/trunk/yjit/src/asm/mod.rs#L252
 
             self.set_pos(ref_pos);
             (label_ref.encode)(self, (ref_pos + label_ref.num_bytes) as i64, label_addr as i64);
+
+            // Assert that we've written the same number of bytes that we
+            // expected to have written.
+            assert!(self.write_pos == ref_pos + label_ref.num_bytes);
         }
 
         self.write_pos = orig_pos;
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]