From eb59b99107dede178105c50d11908a3e21e3f2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Mei=C3=9Fner?= Date: Mon, 17 Jun 2024 12:37:23 +0200 Subject: [PATCH] Workaround for rustc crash caused by 16 byte alined memcpy. --- programs/sbf/rust/sysvar/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/programs/sbf/rust/sysvar/src/lib.rs b/programs/sbf/rust/sysvar/src/lib.rs index 0eddb708dc227d..f3441525d3df29 100644 --- a/programs/sbf/rust/sysvar/src/lib.rs +++ b/programs/sbf/rust/sysvar/src/lib.rs @@ -31,7 +31,7 @@ pub fn process_instruction( sysvar::clock::id().log(); let clock = Clock::from_account_info(&accounts[2]).unwrap(); assert_ne!(clock, Clock::default()); - let got_clock = Clock::get()?; + let got_clock = Clock::get().unwrap(); assert_eq!(clock, got_clock); } @@ -41,7 +41,7 @@ pub fn process_instruction( sysvar::epoch_schedule::id().log(); let epoch_schedule = EpochSchedule::from_account_info(&accounts[3]).unwrap(); assert_eq!(epoch_schedule, EpochSchedule::default()); - let got_epoch_schedule = EpochSchedule::get()?; + let got_epoch_schedule = EpochSchedule::get().unwrap(); assert_eq!(epoch_schedule, got_epoch_schedule); } @@ -49,8 +49,8 @@ pub fn process_instruction( msg!("Instructions identifier:"); sysvar::instructions::id().log(); assert_eq!(*accounts[4].owner, sysvar::id()); - let index = instructions::load_current_index_checked(&accounts[4])?; - let instruction = instructions::load_instruction_at_checked(index as usize, &accounts[4])?; + let index = instructions::load_current_index_checked(&accounts[4]).unwrap(); + let instruction = instructions::load_instruction_at_checked(index as usize, &accounts[4]).unwrap(); assert_eq!(0, index); assert_eq!( instruction, @@ -88,7 +88,7 @@ pub fn process_instruction( msg!("Rent identifier:"); sysvar::rent::id().log(); let rent = Rent::from_account_info(&accounts[6]).unwrap(); - let got_rent = Rent::get()?; + let got_rent = Rent::get().unwrap(); assert_eq!(rent, got_rent); } @@ -119,7 +119,7 @@ pub fn process_instruction( msg!("Fee identifier:"); sysvar::fees::id().log(); let fees = Fees::from_account_info(&accounts[10]).unwrap(); - let got_fees = Fees::get()?; + let got_fees = Fees::get().unwrap(); assert_eq!(fees, got_fees); } @@ -128,7 +128,7 @@ pub fn process_instruction( msg!("EpochRewards identifier:"); sysvar::epoch_rewards::id().log(); let epoch_rewards = EpochRewards::from_account_info(&accounts[11]).unwrap(); - let got_epoch_rewards = EpochRewards::get()?; + let got_epoch_rewards = EpochRewards::get().unwrap(); assert_eq!(epoch_rewards, got_epoch_rewards); }