2010-05-05 Michael Snyder <msnyder@vmware.com>
[deliverable/binutils-gdb.git] / gdb / p-lang.c
index c768d1bec3dc3ed6ed2cbfbe1499d085f9e8c7db..44aefa4a112849533d6df7f474054d6c50c78801 100644 (file)
@@ -101,7 +101,7 @@ is_pascal_string_type (struct type *type,int *length_pos,
                       struct type **char_type,
                       char **arrayname)
 {
-  if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
+  if (type != NULL && TYPE_CODE (type) == TYPE_CODE_STRUCT)
     {
       /* Old Borland type pascal strings from Free Pascal Compiler.  */
       /* Two fields: length and st.  */
@@ -158,9 +158,7 @@ static void
 pascal_one_char (int c, struct ui_file *stream, int *in_quotes)
 {
 
-  c &= 0xFF;                   /* Avoid sign bit follies */
-
-  if ((c == '\'') || (PRINT_LITERAL_FORM (c)))
+  if (c == '\'' || ((unsigned int) c <= 0xff && (PRINT_LITERAL_FORM (c))))
     {
       if (!(*in_quotes))
        fputs_filtered ("'", stream);
This page took 0.029045 seconds and 4 git commands to generate.