Fix signalling of success/failure (by @mthom)

This commit is contained in:
Nicolas Luck
2023-10-16 14:56:17 +02:00
parent 025412aac0
commit d7fa6c0ade
2 changed files with 29 additions and 21 deletions

View File

@@ -60,7 +60,6 @@ use std::sync::atomic::AtomicBool;
use self::config::MachineConfig;
use self::parsed_results::*;
use tokio::runtime::Runtime;
use rand::rngs::StdRng;
use rand::SeedableRng;
@@ -118,6 +117,7 @@ include!(concat!(env!("OUT_DIR"), "/libraries.rs"));
pub static BREAK_FROM_DISPATCH_LOOP_LOC: usize = 0;
pub static INSTALL_VERIFY_ATTR_INTERRUPT: usize = 1;
pub static VERIFY_ATTR_INTERRUPT_LOC: usize = 2;
pub static LIB_QUERY_SUCCESS: usize = 3;
pub struct MachinePreludeView<'a> {
pub indices: &'a mut IndexStore,
@@ -397,13 +397,14 @@ impl Machine {
}
pub(crate) fn add_impls_to_indices(&mut self) {
let impls_offset = self.code.len() + 3;
let impls_offset = self.code.len() + 4;
self.code.extend(
vec![
Instruction::BreakFromDispatchLoop,
Instruction::InstallVerifyAttr,
Instruction::VerifyAttrInterrupt,
Instruction::BreakFromDispatchLoop, // the location of LIB_QUERY_SUCCESS
Instruction::ExecuteTermGreaterThan,
Instruction::ExecuteTermLessThan,
Instruction::ExecuteTermGreaterThanOrEqual,