Skip to content

Commit

Permalink
add a sanity check to ensure that we don't try to wrap the debug ctx …
Browse files Browse the repository at this point in the history
…twice
  • Loading branch information
antocuni committed Feb 9, 2021
1 parent ed855a1 commit 8c492e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hpy/debug/src/debug_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ static int debug_ctx_init(HPyContext dctx, HPyContext uctx)
HPyContext hpy_debug_get_ctx(HPyContext uctx)
{
HPyContext dctx = &g_debug_ctx;
if (uctx == dctx) {
HPy_FatalError(uctx, "hpy_debug_get_ctx: expected an universal ctx, "
"got a debug ctx");
}
if (debug_ctx_init(dctx, uctx) < 0)
return NULL;
return dctx;
Expand Down

0 comments on commit 8c492e8

Please sign in to comment.