emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 81131ff 1/2: Re-add a useful assertion


From: Philipp Stephani
Subject: [Emacs-diffs] master 81131ff 1/2: Re-add a useful assertion
Date: Sun, 9 Jul 2017 18:34:10 -0400 (EDT)

branch: master
commit 81131ff26fe2a36c2ed0a4853d85af3bcb8bbdb1
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>

    Re-add a useful assertion
    
    * src/emacs-module.c (module_free_global_ref): Re-add assertion that
    the reference count is zero.  This assertion was removed in commit
    8afaa1321f8088bfb877fe4b6676e8517adb0bb7, but it's not included in the
    test performed by XFASTINT before, because the previous reference
    count could have been zero already in the case of a buggy
    implementation.  This assertion might have detected Bug#27587.
---
 src/emacs-module.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/emacs-module.c b/src/emacs-module.c
index ba99698..7e0ba3c 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -328,7 +328,10 @@ module_free_global_ref (emacs_env *env, emacs_value ref)
           set_hash_value_slot (h, i, value);
         }
       else
-       hash_remove_from_table (h, obj);
+        {
+          eassert (refcount == 0);
+          hash_remove_from_table (h, obj);
+        }
     }
 
   if (module_assertions)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]