git.delta.rocks / jrsonnet / refs/commits / 259b3abbb098

difftreelog

fix ensure stack for deep manifest recursion

qooxlqlmYaroslav Bolyukin2026-04-25parent: #f3c8ed7.patch.diff
in: master

1 file changed

modifiedcrates/jrsonnet-evaluator/src/manifest.rsdiffbeforeafterboth
1use std::{borrow::Cow, fmt::Write, hint::black_box, ptr};1use std::{borrow::Cow, fmt::Write, hint::black_box, ptr};
22
3use crate::{Result, ResultExt, Val, bail, in_description_frame};3use crate::{
4 bail, evaluate::ensure_sufficient_stack, in_description_frame, Error,
5 Result, ResultExt, Val,
6};
47
252 write!(buf, "{:?}", n.to_string()).unwrap();255 write!(buf, "{:?}", n.to_string()).unwrap();
253 }256 }
254 }257 }
255 Val::Arr(items) => {258 Val::Arr(items) => ensure_sufficient_stack(|| {
256 buf.push('[');259 buf.push('[');
257260
258 let old_len = cur_padding.len();261 let old_len = cur_padding.len();
304 }307 }
305308
306 buf.push(']');309 buf.push(']');
310 Ok::<_, Error>(())
307 }311 })?,
308 Val::Obj(obj) => {312 Val::Obj(obj) => ensure_sufficient_stack(|| {
309 obj.run_assertions()?;313 obj.run_assertions()?;
310 buf.push('{');314 buf.push('{');
311315
366 }370 }
367371
368 buf.push('}');372 buf.push('}');
373 Ok::<_, Error>(())
369 }374 })?,
370 Val::Func(_) => bail!("tried to manifest function"),375 Val::Func(_) => bail!("tried to manifest function"),
371 }376 }
372 Ok(())377 Ok(())