* Problem report #58
@ 2006-04-11 15:49 Dan Nicolaescu
2006-04-11 17:14 ` Stuart D. Herring
0 siblings, 1 reply; 2+ messages in thread
From: Dan Nicolaescu @ 2006-04-11 15:49 UTC (permalink / raw)
CID: 58
Checker: UNINIT (help)
File: emacs/src/editfns.c
Function: Ftranslate_region_internal
Description: Using uninitialized value "str"
Event var_decl: Declared variable "str" without initializer
Also see events: [uninit_use_in_call][uninit_use]
2887 unsigned char *str, buf[MAX_MULTIBYTE_LENGTH];
2888 int len, str_len;
2889 int oc;
2890
At conditional (2): "multibyte != 0" taking true path
2891 if (multibyte)
At conditional (3): "*p < 128" taking true path
At conditional (4): "((*p < 128) ? 1 : (bytes_by_char_head[*p])) == 1" taking true path
2892 oc = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, len);
2893 else
2894 oc = *p, len = 1;
At conditional (5): "oc < size" taking true path
2895 if (oc < size)
2896 {
At conditional (6): "tt != 0" taking false path
2897 if (tt)
2898 {
2899 /* Reload as signal_after_change in last iteration may GC. */
2900 tt = SDATA (table);
2901 if (string_multibyte)
2902 {
2903 str = tt + string_char_to_byte (table, oc);
2904 nc = STRING_CHAR_AND_LENGTH (str, MAX_MULTIBYTE_LENGTH,
2905 str_len);
2906 }
2907 else
2908 {
2909 nc = tt[oc];
2910 if (! ASCII_BYTE_P (nc) && multibyte)
2911 {
2912 str_len = CHAR_STRING (nc, buf);
2913 str = buf;
2914 }
2915 else
2916 {
2917 str_len = 1;
2918 str = tt + oc;
2919 }
2920 }
2921 }
2922 else
2923 {
2924 Lisp_Object val;
2925 int c;
2926
2927 nc = oc;
At conditional (7): "oc >= 0" taking true path
At conditional (8): "oc < 256" taking true path
At conditional (9): "(table & -8)->contents[oc] != Qnil" taking true path
2928 val = CHAR_TABLE_REF (table, oc);
At conditional (10): "val & 7 == 0" taking true path
At conditional (11): "c >= 0" taking true path
At conditional (12): "c & 255 == c" taking false path
At conditional (13): "char_valid_p != 0" taking false path
2929 if (INTEGERP (val)
2930 && (c = XINT (val), CHAR_VALID_P (c, 0)))
2931 {
2932 nc = c;
2933 str_len = CHAR_STRING (nc, buf);
2934 str = buf;
2935 }
2936 }
2937
At conditional (14): "nc != oc" taking true path
2938 if (nc != oc)
2939 {
At conditional (15): "len != str_len" taking true path
2940 if (len != str_len)
2941 {
2942 Lisp_Object string;
2943
2944 /* This is less efficient, because it moves the gap,
2945 but it should multibyte characters correctly. */
Event uninit_use_in_call: Using uninitialized value "str" in call to function "make_multibyte_string" [model]
Also see events: [var_decl][uninit_use]
2946 string = make_multibyte_string (str, 1, str_len);
2947 replace_range (pos, pos + 1, string, 1, 0, 1);
2948 len = str_len;
2949 }
2950 else
2951 {
2952 record_change (pos, 1);
2953 while (str_len-- > 0)
Event uninit_use: Using uninitialized value "str"
Also see events: [var_decl][uninit_use_in_call]
2954 *p++ = *str++;
2955 signal_after_change (pos, 1, 1);
2956 update_compositions (pos, pos + 1, CHECK_BORDER);
2957 }
2958 ++cnt;
2959 }
2960 }
2961 pos_byte += len;
2962 pos++;
2963 }
2964
2965 return make_number (cnt);
2966 }
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Problem report #58
2006-04-11 15:49 Problem report #58 Dan Nicolaescu
@ 2006-04-11 17:14 ` Stuart D. Herring
0 siblings, 0 replies; 2+ messages in thread
From: Stuart D. Herring @ 2006-04-11 17:14 UTC (permalink / raw)
> 2927 nc = oc;
> 2928 val = CHAR_TABLE_REF (table, oc);
> 2929 if (INTEGERP (val)
> 2930 && (c = XINT (val), CHAR_VALID_P (c, 0)))
> 2931 {
> 2932 nc = c;
> 2933 str_len = CHAR_STRING (nc, buf);
> 2934 str = buf;
> 2935 }
> 2936 }
So here either nc remains == to oc, or str is assigned.
> At conditional (14): "nc != oc" taking true path
>
> 2938 if (nc != oc)
> 2939 {
>
OK, so str was assigned. No bug.
Davis
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-04-11 17:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-11 15:49 Problem report #58 Dan Nicolaescu
2006-04-11 17:14 ` Stuart D. Herring
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.