You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not allowed to pass a null pointer to slice::from_raw_parts. An empty blob can be obtained by compiling successfully without warnings, then calling get_error_buffer (useful for obtaining compiler warnings) on the Ok result of DxcCompiler::compile:
let result = dxc_compiler.compile(&source_blob,
source_path.as_ref(),
entry_point,
target_profile,&args,Some(&mutIncludeHandler),/* defines */&[],);match result {Ok(ok) => {let err = ok.get_error_buffer()?;// thread 'main' panicked at library/core/src/panicking.rs:218:5:// unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`//// This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.let err = dxc_library.get_blob_as_string(&err.into())?;println!("cargo::warning={err}");Ok(())},Err(err) => {let err = err.0.get_error_buffer()?;let err = dxc_library.get_blob_as_string(&err.into())?;Err(HassleError::CompileError(err).into())},}