diff --git a/src/x86_64/Gstash_frame.c b/src/x86_64/Gstash_frame.c
index da60613b..b09f247d 100644
--- a/src/x86_64/Gstash_frame.c
+++ b/src/x86_64/Gstash_frame.c
@@ -81,11 +81,13 @@ tdep_stash_frame (struct dwarf_cursor *d, struct dwarf_reg_state *rs)
        their ucontext_t offsets.  Confirm DWARF info agrees with the
        offsets we expect.  */
 
+#ifdef NDEBUG
     const unw_word_t uc = c->sigcontext_addr;
 
     assert (DWARF_GET_LOC(d->loc[RIP]) - uc == UC_MCONTEXT_GREGS_RIP);
     assert (DWARF_GET_LOC(d->loc[RBP]) - uc == UC_MCONTEXT_GREGS_RBP);
     assert (DWARF_GET_LOC(d->loc[RSP]) - uc == UC_MCONTEXT_GREGS_RSP);
+#endif
 
     Debug (4, " sigreturn frame\n");
   }