[gspell/gspell-1-2] InlineCheckerTextBuffer: replace g_assert_cmpint() by g_return_if_fail()



commit a387b11dd402639dea5832a1a1139fa2885eb40f
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Feb 24 12:57:20 2017 +0100

    InlineCheckerTextBuffer: replace g_assert_cmpint() by g_return_if_fail()
    
    To avoid a crash. I don't understand why it sometimes fails, probably
    because of a bug in a lower-level library (GTK+ or Pango). We don't have
    steps to reproduce the problem, just a backtrace on the Fedora Retrace
    server.
    
    On master (leading towards the 1.4 version), the g_assert_cmpint() has
    not been changed to the g_return_if_fail(), more assertions have been
    added instead, so we will likely see again crashes for the 1.4 version,
    which will give us more information. For the 1.2 branch I prefer to make
    it more stable, while early adopters of 1.3/1.4 can serve as testers.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778883

 gspell/gspell-inline-checker-text-buffer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gspell/gspell-inline-checker-text-buffer.c b/gspell/gspell-inline-checker-text-buffer.c
index 8af6f3f..b69c2fb 100644
--- a/gspell/gspell-inline-checker-text-buffer.c
+++ b/gspell/gspell-inline-checker-text-buffer.c
@@ -253,7 +253,7 @@ check_subregion (GspellInlineCheckerTextBuffer *spell,
 
                _gspell_text_iter_backward_word_start (&word_start);
                g_assert (_gspell_text_iter_starts_word (&word_start));
-               g_assert_cmpint (gtk_text_iter_compare (start, &word_start), <, 0);
+               g_return_if_fail (gtk_text_iter_compare (start, &word_start) < 0);
        }
 
        while (_gspell_utils_skip_no_spell_check (spell->no_spell_check_tag, &word_start, end) &&


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