comparison lphobos/internal/eh.d @ 662:88e23f8c2354

Applied downs' latest Phobos patch
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Mon, 06 Oct 2008 21:40:33 +0200
parents 373489eeaf90
children
comparison
equal deleted inserted replaced
661:99f32e967746 662:88e23f8c2354
285 return _Unwind_Reason_Code.CONTINUE_UNWIND; 285 return _Unwind_Reason_Code.CONTINUE_UNWIND;
286 } else 286 } else
287 action_walker += next_action_offset; 287 action_walker += next_action_offset;
288 } 288 }
289 289
290 printf("Assertion failure ;_;\n"); 290 /*printf("Assertion failure ;_;\n");
291 assert(false); 291 assert(false);*/
292 } 292 }
293 293
294 // These are the register numbers for SetGR that 294 // These are the register numbers for SetGR that
295 // llvm's eh.exception and eh.selector intrinsics 295 // llvm's eh.exception and eh.selector intrinsics
296 // will pick up. 296 // will pick up.
351 callsite = data; 351 callsite = data;
352 } 352 }
353 353
354 } // end of x86 Linux specific implementation 354 } // end of x86 Linux specific implementation
355 355
356 extern(C) void* malloc(size_t size);
356 357
357 extern(C) void _d_throw_exception(Object e) 358 extern(C) void _d_throw_exception(Object e)
358 { 359 {
359 if (e !is null) 360 if (e !is null)
360 { 361 {
361 _d_exception* exc_struct = new _d_exception; 362 // _d_exception* exc_struct = new _d_exception;
363 auto exc_struct = cast(_d_exception*)malloc(_d_exception.sizeof);
362 exc_struct.unwind_info.exception_class[] = _d_exception_class; 364 exc_struct.unwind_info.exception_class[] = _d_exception_class;
363 exc_struct.exception_object = e; 365 exc_struct.exception_object = e;
364 printf("Raising exception\n"); 366 printf("Raising exception\n");
365 _Unwind_Reason_Code ret = _Unwind_RaiseException(&exc_struct.unwind_info); 367 _Unwind_Reason_Code ret = _Unwind_RaiseException(&exc_struct.unwind_info);
366 printf("_Unwind_RaiseException failed with reason code: %i\n", ret); 368 printf("_Unwind_RaiseException failed with reason code: %i\n", ret);