-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
//! This panics
#![no_std]
#![no_main]
use psp::{Align16, module, sys};
static mut GE_LIST: Align16<[u8; 0x10000]> = Align16([0; 0x10000]);
module!("panic", 0, 1);
fn psp_main() {
unsafe {
use sys::*;
sceGuInit();
sceGuStart(GuContextType::Direct, (&raw mut GE_LIST.0).cast());
sceGuFinish();
sceGuSync(GuSyncMode::Finish, GuSyncBehavior::Wait);
}
let size = unsafe { sys::sceGuCheckList() };
psp::dprintln!("GU list bytes used: {size}");
}Panic message:
panicked at PSP_REGISTRY_SOURCE/psp-0.3.12/src/sys/gu.rs:1853:21: unsafe precondition(s) violated: ptr::sub requires that the address calculation does not overflow
This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety
- Tested on PPSSPP with "Ignore bad memory access" disabled, not tested on real PSP.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels