Skip to content

Commit b42c99c

Browse files
committed
Changelog and no_std
1 parent b92a4db commit b42c99c

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* Fix prover input.
2222
* Fix version reading when no version is supplied.
2323

24+
* feat: Add support for ByteArray in DebugPrint: [#1853](https://github.com/lambdaclass/cairo-vm/pull/1853)
25+
* Debug print handler is swapped with the implementation from cairo-lang-runner
2426

2527
* chore: bump `cairo-lang-` dependencies to 2.7.1 [#1823](https://github.com/lambdaclass/cairo-vm/pull/1823)
2628

vm/src/hint_processor/cairo_1_hint_processor/hint_processor.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use super::dict_manager::DictManagerExecScope;
22
use super::hint_processor_utils::*;
33
use crate::any_box;
4-
use crate::hint_processor::cairo_1_hint_processor::debug_print::format_for_debug;
54
use crate::hint_processor::cairo_1_hint_processor::dict_manager::DictSquashExecScope;
65
use crate::hint_processor::hint_processor_definition::HintReference;
76
use crate::stdlib::{boxed::Box, collections::HashMap, prelude::*};
@@ -108,11 +107,17 @@ impl Cairo1HintProcessor {
108107
quotient,
109108
remainder,
110109
})) => self.div_mod(vm, lhs, rhs, quotient, remainder),
110+
111+
#[allow(unused_variables)]
111112
Hint::Core(CoreHintBase::Core(CoreHint::DebugPrint { start, end })) => {
112-
print!(
113-
"{}",
114-
format_for_debug(read_felts(vm, start, end)?.into_iter())
115-
);
113+
#[cfg(feature = "std")]
114+
{
115+
use crate::hint_processor::cairo_1_hint_processor::debug_print::format_for_debug;
116+
print!(
117+
"{}",
118+
format_for_debug(read_felts(vm, start, end)?.into_iter())
119+
);
120+
}
116121
Ok(())
117122
}
118123
Hint::Core(CoreHintBase::Core(CoreHint::Uint256SquareRoot {

vm/src/hint_processor/cairo_1_hint_processor/hint_processor_utils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ pub(crate) fn res_operand_get_val(
134134
}
135135

136136
/// Reads a range of `Felt252`s from the VM.
137+
#[cfg(feature = "std")]
137138
pub(crate) fn read_felts(
138139
vm: &mut VirtualMachine,
139140
start: &ResOperand,

vm/src/hint_processor/cairo_1_hint_processor/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[cfg(feature = "std")]
12
pub mod debug_print;
23
pub mod dict_manager;
34
pub mod hint_processor;

0 commit comments

Comments
 (0)