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

ruby-changes:73294

From: Noah <ko1@a...>
Date: Tue, 30 Aug 2022 01:08:03 +0900 (JST)
Subject: [ruby-changes:73294] 471de2ab78 (master): Enable skipdata on Capstone to allow embedded data without early stop to disasm (https://github.com/Shopify/ruby/pull/398)

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

From 471de2ab78ef75c7f22f80c77460e16e2356e190 Mon Sep 17 00:00:00 2001
From: Noah Gibbs <the.codefolio.guy@g...>
Date: Thu, 11 Aug 2022 17:11:23 +0100
Subject: Enable skipdata on Capstone to allow embedded data without early stop
 to disasm (https://github.com/Shopify/ruby/pull/398)

---
 yjit/src/disasm.rs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/yjit/src/disasm.rs b/yjit/src/disasm.rs
index 62b270bce9..015c0c25ef 100644
--- a/yjit/src/disasm.rs
+++ b/yjit/src/disasm.rs
@@ -71,7 +71,7 @@ pub fn disasm_iseq_insn_range(iseq: IseqPtr, start_idx: u32, end_idx: u32) -> St https://github.com/ruby/ruby/blob/trunk/yjit/src/disasm.rs#L71
     use capstone::prelude::*;
 
     #[cfg(target_arch = "x86_64")]
-    let cs = Capstone::new()
+    let mut cs = Capstone::new()
         .x86()
         .mode(arch::x86::ArchMode::Mode64)
         .syntax(arch::x86::ArchSyntax::Intel)
@@ -79,11 +79,13 @@ pub fn disasm_iseq_insn_range(iseq: IseqPtr, start_idx: u32, end_idx: u32) -> St https://github.com/ruby/ruby/blob/trunk/yjit/src/disasm.rs#L79
         .unwrap();
 
     #[cfg(target_arch = "aarch64")]
-    let cs = Capstone::new()
+    let mut cs = Capstone::new()
         .arm64()
         .mode(arch::arm64::ArchMode::Arm)
+        .detail(true)
         .build()
         .unwrap();
+    cs.set_skipdata(true);
 
     out.push_str(&format!("NUM BLOCK VERSIONS: {}\n", block_list.len()));
     out.push_str(&format!(
-- 
cgit v1.2.1


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

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