diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2011-08-09 18:13:11 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2011-08-09 18:13:11 -0400 |
commit | 7be1c708c5abc7dea388d45454bd19bff07b7943 (patch) | |
tree | 4d86b007b24388f25e83515bd86c42d14de9b77a /src | |
parent | ebb552ed380b9f04e0c6b29374b3d32435837951 (diff) | |
parent | 8d96c9a4e700ad17921f8d2c90f4244bfa4b98b1 (diff) | |
download | emacs-7be1c708c5abc7dea388d45454bd19bff07b7943.tar.gz emacs-7be1c708c5abc7dea388d45454bd19bff07b7943.tar.bz2 emacs-7be1c708c5abc7dea388d45454bd19bff07b7943.zip |
Merge from emacs-23 branch
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 12 | ||||
-rw-r--r-- | src/fontset.c | 8 | ||||
-rw-r--r-- | src/unexmacosx.c | 37 |
3 files changed, 55 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4d493eab7b1..af9586037d7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2011-08-09 Andreas Schwab <schwab@linux-m68k.org> + + * fontset.c (fontset_get_font_group): Add proper type checks. + (Bug#9172) + +2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS + and LC_VERSION_MIN_MACOSX. + (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function. + (dump_it) [LC_FUNCTION_STARTS]: Use it. + 2011-08-08 Eli Zaretskii <eliz@gnu.org> * xdisp.c (forward_to_next_line_start): Allow to use the diff --git a/src/fontset.c b/src/fontset.c index 74eb61d2665..c8ae1e74848 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -447,7 +447,7 @@ reorder_font_vector (Lisp_Object font_group, struct font *font) /* Return a font-group (actually a cons (-1 . FONT-GROUP-VECTOR)) for character C in FONTSET. If C is -1, return a fallback font-group. If C is not -1, the value may be Qt (FONTSET doesn't have a font - for C even in the fallback group, or 0 (a font for C may be found + for C even in the fallback group), or 0 (a font for C may be found only in the fallback group). */ static Lisp_Object @@ -465,7 +465,9 @@ fontset_get_font_group (Lisp_Object fontset, int c) if (! NILP (font_group)) return font_group; base_fontset = FONTSET_BASE (fontset); - if (c >= 0) + if (NILP (base_fontset)) + font_group = Qnil; + else if (c >= 0) font_group = char_table_ref_and_range (base_fontset, c, &from, &to); else font_group = FONTSET_FALLBACK (base_fontset); @@ -476,6 +478,8 @@ fontset_get_font_group (Lisp_Object fontset, int c) char_table_set_range (fontset, from, to, font_group); return font_group; } + if (!VECTORP (font_group)) + return font_group; font_group = Fcopy_sequence (font_group); for (i = 0; i < ASIZE (font_group); i++) if (! NILP (AREF (font_group, i))) diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 04e3edf463e..0751eeacb9b 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -599,6 +599,16 @@ print_load_command_name (int lc) printf ("LC_DYLD_INFO_ONLY"); break; #endif +#ifdef LC_VERSION_MIN_MACOSX + case LC_VERSION_MIN_MACOSX: + printf ("LC_VERSION_MIN_MACOSX"); + break; +#endif +#ifdef LC_FUNCTION_STARTS + case LC_FUNCTION_STARTS: + printf ("LC_FUNCTION_STARTS"); + break; +#endif default: printf ("unknown "); } @@ -1135,6 +1145,28 @@ copy_dyld_info (struct load_command *lc, long delta) } #endif +#ifdef LC_FUNCTION_STARTS +/* Copy a LC_FUNCTION_STARTS load command from the input file to the + output file, adjusting the data offset field. */ +static void +copy_linkedit_data (struct load_command *lc, long delta) +{ + struct linkedit_data_command *ldp = (struct linkedit_data_command *) lc; + + if (ldp->dataoff > 0) + ldp->dataoff += delta; + + printf ("Writing "); + print_load_command_name (lc->cmd); + printf (" command\n"); + + if (!unexec_write (curr_header_offset, lc, lc->cmdsize)) + unexec_error ("cannot write linkedit data command to header"); + + curr_header_offset += lc->cmdsize; +} +#endif + /* Copy other kinds of load commands from the input file to the output file, ones that do not require adjustments of file offsets. */ static void @@ -1207,6 +1239,11 @@ dump_it (void) copy_dyld_info (lca[i], linkedit_delta); break; #endif +#ifdef LC_FUNCTION_STARTS + case LC_FUNCTION_STARTS: + copy_linkedit_data (lca[i], linkedit_delta); + break; +#endif default: copy_other (lca[i]); break; |