@@ -492,6 +487,42 @@ class ClientAgent(microVM: MicroVM) {
microVM.trapManager.disableWatchPoint(wpID)
}
defptrcast(handle:Handle,newType:Type):Handle={
require(handle.ty.isInstanceOf[AbstractPointerType]||handle.ty.isInstanceOf[TypeInt],"handle must have type int, ptr or funcptr. %s found".format(handle.ty.repr))
require(newType.isInstanceOf[AbstractPointerType]||newType.isInstanceOf[TypeInt],"can only convert to int, ptr or funcptr. %s found".format(newType.repr))