浏览代码

[LibOS] Assert that context != NULL in shim_signal.c: illegal_upcall()

Alex Merritt 6 年之前
父节点
当前提交
fdc206d339
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      LibOS/shim/src/bookkeep/shim_signal.c

+ 3 - 2
LibOS/shim/src/bookkeep/shim_signal.c

@@ -472,8 +472,9 @@ static void illegal_upcall (PAL_PTR event, PAL_NUM arg, PAL_CONTEXT * context)
         !context_is_internal(context) &&
         !(lookup_vma((void *) arg, &vma)) &&
         !(vma.flags & VMA_INTERNAL)) {
-        if (context)
-            debug("illegal instruction at 0x%08lx\n", context->IP);
+
+        assert(context);
+        debug("illegal instruction at 0x%08lx\n", context->IP);
 
         uint8_t * rip = (uint8_t*)context->IP;
         /*