[RTL]
[reactos.git] / reactos / lib / rtl / i386 / except.c
index 66a9d81..0165fff 100644 (file)
@@ -33,7 +33,7 @@ RtlGetCallersAddress(OUT PVOID *CallersAddress,
     /* Only if user want it */
     if (*CallersAddress != NULL)
     {
-        /* only when first frames exist */ 
+        /* only when first frames exist */
         if (FrameCount >= 1)
         {
             *CallersAddress = BackTrace[0];
@@ -47,7 +47,7 @@ RtlGetCallersAddress(OUT PVOID *CallersAddress,
     /* Only if user want it */
     if (*CallersCaller != NULL)
     {
-        /* only when second frames exist */ 
+        /* only when second frames exist */
         if (FrameCount >= 2)
         {
             *CallersCaller = BackTrace[1];
@@ -92,6 +92,9 @@ RtlDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
     /* Now loop every frame */
     while (RegistrationFrame != EXCEPTION_CHAIN_END)
     {
+        /* Registration chain entries are never NULL */
+        ASSERT(RegistrationFrame != NULL);
+
         /* Find out where it ends */
         RegistrationFrameEnd = (ULONG_PTR)RegistrationFrame +
                                 sizeof(EXCEPTION_REGISTRATION_RECORD);
@@ -127,8 +130,7 @@ RtlDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
                                                      RegistrationFrame,
                                                      Context,
                                                      &DispatcherContext,
-                                                     RegistrationFrame->
-                                                     Handler);
+                                                     RegistrationFrame->Handler);
 
         /* Check if this is a nested frame */
         if (RegistrationFrame == NestedFrame)
@@ -274,6 +276,9 @@ RtlUnwind(IN PVOID TargetFrame OPTIONAL,
     /* Now loop every frame */
     while (RegistrationFrame != EXCEPTION_CHAIN_END)
     {
+        /* Registration chain entries are never NULL */
+        ASSERT(RegistrationFrame != NULL);
+
         /* If this is the target */
         if (RegistrationFrame == TargetFrame) ZwContinue(Context, FALSE);
 
@@ -326,8 +331,7 @@ RtlUnwind(IN PVOID TargetFrame OPTIONAL,
                                                       RegistrationFrame,
                                                       Context,
                                                       &DispatcherContext,
-                                                      RegistrationFrame->
-                                                      Handler);
+                                                      RegistrationFrame->Handler);
             switch(Disposition)
             {
                 /* Continue searching */