commit 49f7c5ad68cb9c542cfddee7bed17d207f1fc394 (HEAD, refs/remotes/origin/master) Author: Alan Third Date: Fri Jul 15 21:02:47 2016 +0100 Fix cursor display (bug#23993) * src/xdisp.c (get_phys_cursor_geometry): Fix invalid C operator. diff --git a/src/xdisp.c b/src/xdisp.c index 14d6f8f..efd5f54 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2237,7 +2237,7 @@ get_phys_cursor_geometry (struct window *w, struct glyph_row *row, ascent = row->ascent; if (row->ascent < glyph->ascent) { - y =- glyph->ascent - row->ascent; + y -= glyph->ascent - row->ascent; ascent = glyph->ascent; } commit 9569916d94c6c448862d02919e52fc3bfb9b9c8d Author: Paul Eggert Date: Fri Jul 15 22:15:43 2016 +0200 Stop worrying about Alliant in bytecode.c * src/bytecode.c (PUSH): Remove workaround for long-obsolete compiler. diff --git a/src/bytecode.c b/src/bytecode.c index a551eca..bb7922d 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -338,12 +338,10 @@ relocate_byte_stack (void) #define FETCH2 (op = FETCH, op + (FETCH << 8)) -/* Push x onto the execution stack. This used to be #define PUSH(x) - (*++stackp = (x)) This oddity is necessary because Alliant can't be - bothered to compile the preincrement operator properly, as of 4/91. - -JimB */ +/* Push X onto the execution stack. The expression X should not + contain TOP, to avoid competing side effects. */ -#define PUSH(x) (top++, *top = (x)) +#define PUSH(x) (*++top = (x)) /* Pop a value off the execution stack. */ commit 4ba72d329525332798b3b222eaec0efc8a23ac75 Author: Paul Eggert Date: Fri Jul 15 22:15:42 2016 +0200 Remove BYTE_MAINTAIN_TOP It is no longer needed now that we assume GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS. * src/bytecode.c (BYTE_MAINTAIN_TOP): Remove. All uses removed, and code simplified accordingly. (BEFORE_POTENTIAL_GC, AFTER_POTENTIAL_GC): Remove, since they are always no-ops now. All uses removed. (MAYBE_GC): Remove. All uses replaced by maybe_gc, since it is now equivalent. diff --git a/src/bytecode.c b/src/bytecode.c index 75d51cc..a551eca 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -278,9 +278,6 @@ enum byte_code_op Bset_mark = 0163, /* this loser is no longer generated as of v18 */ #endif }; - -/* Whether to maintain a `top' and `bottom' field in the stack frame. */ -#define BYTE_MAINTAIN_TOP BYTE_CODE_SAFE /* Structure describing a value stack used during byte-code execution in Fbyte_code. */ @@ -291,12 +288,6 @@ struct byte_stack and is relocated when that string is relocated. */ const unsigned char *pc; - /* Top and bottom of stack. The bottom points to an area of memory - allocated with alloca in Fbyte_code. */ -#if BYTE_MAINTAIN_TOP - Lisp_Object *top, *bottom; -#endif - /* The string containing the byte-code, and its current address. Storing this here protects it from GC. */ Lisp_Object byte_string; @@ -367,27 +358,6 @@ relocate_byte_stack (void) #define TOP (*top) -/* Actions that must be performed before and after calling a function - that might GC. */ - -#if !BYTE_MAINTAIN_TOP -#define BEFORE_POTENTIAL_GC() ((void)0) -#define AFTER_POTENTIAL_GC() ((void)0) -#else -#define BEFORE_POTENTIAL_GC() stack.top = top -#define AFTER_POTENTIAL_GC() stack.top = NULL -#endif - -/* Garbage collect if we have consed enough since the last time. - We do this at every branch, to avoid loops that never GC. */ - -#define MAYBE_GC() \ - do { \ - BEFORE_POTENTIAL_GC (); \ - maybe_gc (); \ - AFTER_POTENTIAL_GC (); \ - } while (0) - /* Check for jumping out of range. */ #ifdef BYTE_CODE_SAFE @@ -410,11 +380,9 @@ relocate_byte_stack (void) { \ Lisp_Object flag = Vquit_flag; \ Vquit_flag = Qnil; \ - BEFORE_POTENTIAL_GC (); \ if (EQ (Vthrow_on_input, flag)) \ Fthrow (Vthrow_on_input, Qt); \ Fsignal (Qquit, Qnil); \ - AFTER_POTENTIAL_GC (); \ } \ else if (pending_signals) \ process_pending_signals (); \ @@ -504,10 +472,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, if (MAX_ALLOCA / word_size <= XFASTINT (maxdepth)) memory_full (SIZE_MAX); top = alloca ((XFASTINT (maxdepth) + 1) * sizeof *top); -#if BYTE_MAINTAIN_TOP - stack.bottom = top + 1; - stack.top = NULL; -#endif stack.next = byte_stack_list; byte_stack_list = &stack; @@ -676,16 +640,12 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, || (v2 = SYMBOL_VAL (XSYMBOL (v1)), EQ (v2, Qunbound))) { - BEFORE_POTENTIAL_GC (); v2 = Fsymbol_value (v1); - AFTER_POTENTIAL_GC (); } } else { - BEFORE_POTENTIAL_GC (); v2 = Fsymbol_value (v1); - AFTER_POTENTIAL_GC (); } PUSH (v2); NEXT; @@ -694,7 +654,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bgotoifnil): { Lisp_Object v1; - MAYBE_GC (); + maybe_gc (); op = FETCH2; v1 = POP; if (NILP (v1)) @@ -716,7 +676,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, TOP = Qnil; else { - BEFORE_POTENTIAL_GC (); wrong_type_argument (Qlistp, v1); } NEXT; @@ -733,10 +692,8 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bmemq): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fmemq (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } @@ -750,7 +707,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, TOP = Qnil; else { - BEFORE_POTENTIAL_GC (); wrong_type_argument (Qlistp, v1); } NEXT; @@ -786,9 +742,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, SET_SYMBOL_VAL (XSYMBOL (sym), val); else { - BEFORE_POTENTIAL_GC (); set_internal (sym, val, Qnil, 0); - AFTER_POTENTIAL_GC (); } } (void) POP; @@ -821,9 +775,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, op -= Bvarbind; varbind: /* Specbind can signal and thus GC. */ - BEFORE_POTENTIAL_GC (); specbind (vectorp[op], POP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bcall6): @@ -843,7 +795,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, op -= Bcall; docall: { - BEFORE_POTENTIAL_GC (); DISCARD (op); #ifdef BYTE_CODE_METER if (byte_metering_on && SYMBOLP (TOP)) @@ -861,7 +812,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, } #endif TOP = Ffuncall (op + 1, &TOP); - AFTER_POTENTIAL_GC (); NEXT; } @@ -881,21 +831,17 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bunbind5): op -= Bunbind; dounbind: - BEFORE_POTENTIAL_GC (); unbind_to (SPECPDL_INDEX () - op, Qnil); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bunbind_all): /* Obsolete. Never used. */ /* To unbind back to the beginning of this frame. Not used yet, but will be needed for tail-recursion elimination. */ - BEFORE_POTENTIAL_GC (); unbind_to (count, Qnil); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bgoto): - MAYBE_GC (); + maybe_gc (); BYTE_CODE_QUIT; op = FETCH2; /* pc = FETCH2 loses since FETCH2 contains pc++ */ CHECK_RANGE (op); @@ -905,7 +851,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bgotoifnonnil): { Lisp_Object v1; - MAYBE_GC (); + maybe_gc (); op = FETCH2; v1 = POP; if (!NILP (v1)) @@ -918,7 +864,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, } CASE (Bgotoifnilelsepop): - MAYBE_GC (); + maybe_gc (); op = FETCH2; if (NILP (TOP)) { @@ -930,7 +876,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, NEXT; CASE (Bgotoifnonnilelsepop): - MAYBE_GC (); + maybe_gc (); op = FETCH2; if (!NILP (TOP)) { @@ -942,7 +888,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, NEXT; CASE (BRgoto): - MAYBE_GC (); + maybe_gc (); BYTE_CODE_QUIT; stack.pc += (int) *stack.pc - 127; NEXT; @@ -950,7 +896,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (BRgotoifnil): { Lisp_Object v1; - MAYBE_GC (); + maybe_gc (); v1 = POP; if (NILP (v1)) { @@ -964,7 +910,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (BRgotoifnonnil): { Lisp_Object v1; - MAYBE_GC (); + maybe_gc (); v1 = POP; if (!NILP (v1)) { @@ -976,7 +922,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, } CASE (BRgotoifnilelsepop): - MAYBE_GC (); + maybe_gc (); op = *stack.pc++; if (NILP (TOP)) { @@ -987,7 +933,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, NEXT; CASE (BRgotoifnonnilelsepop): - MAYBE_GC (); + maybe_gc (); op = *stack.pc++; if (!NILP (TOP)) { @@ -1024,10 +970,8 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, ptrdiff_t count1 = SPECPDL_INDEX (); record_unwind_protect (restore_window_configuration, Fcurrent_window_configuration (Qnil)); - BEFORE_POTENTIAL_GC (); TOP = Fprogn (TOP); unbind_to (count1, TOP); - AFTER_POTENTIAL_GC (); NEXT; } @@ -1039,10 +983,8 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bcatch): /* Obsolete since 24.4. */ { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = internal_catch (TOP, eval_sub, v1); - AFTER_POTENTIAL_GC (); NEXT; } @@ -1098,30 +1040,24 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, Lisp_Object handlers, body; handlers = POP; body = POP; - BEFORE_POTENTIAL_GC (); TOP = internal_lisp_condition_case (TOP, body, handlers); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Btemp_output_buffer_setup): /* Obsolete since 24.1. */ - BEFORE_POTENTIAL_GC (); CHECK_STRING (TOP); temp_output_buffer_setup (SSDATA (TOP)); - AFTER_POTENTIAL_GC (); TOP = Vstandard_output; NEXT; CASE (Btemp_output_buffer_show): /* Obsolete since 24.1. */ { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; temp_output_buffer_show (TOP); TOP = v1; /* pop binding of standard-output */ unbind_to (SPECPDL_INDEX () - 1, Qnil); - AFTER_POTENTIAL_GC (); NEXT; } @@ -1129,7 +1065,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, { Lisp_Object v1, v2; EMACS_INT n; - BEFORE_POTENTIAL_GC (); v1 = POP; v2 = TOP; CHECK_NUMBER (v2); @@ -1139,7 +1074,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, v1 = XCDR (v1); immediate_quit = 0; TOP = CAR (v1); - AFTER_POTENTIAL_GC (); NEXT; } @@ -1200,110 +1134,84 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, NEXT; CASE (Blength): - BEFORE_POTENTIAL_GC (); TOP = Flength (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Baref): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Faref (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Baset): { Lisp_Object v1, v2; - BEFORE_POTENTIAL_GC (); v2 = POP; v1 = POP; TOP = Faset (TOP, v1, v2); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bsymbol_value): - BEFORE_POTENTIAL_GC (); TOP = Fsymbol_value (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bsymbol_function): - BEFORE_POTENTIAL_GC (); TOP = Fsymbol_function (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bset): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fset (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bfset): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Ffset (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bget): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fget (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bsubstring): { Lisp_Object v1, v2; - BEFORE_POTENTIAL_GC (); v2 = POP; v1 = POP; TOP = Fsubstring (TOP, v1, v2); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bconcat2): - BEFORE_POTENTIAL_GC (); DISCARD (1); TOP = Fconcat (2, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bconcat3): - BEFORE_POTENTIAL_GC (); DISCARD (2); TOP = Fconcat (3, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bconcat4): - BEFORE_POTENTIAL_GC (); DISCARD (3); TOP = Fconcat (4, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (BconcatN): op = FETCH; - BEFORE_POTENTIAL_GC (); DISCARD (op - 1); TOP = Fconcat (op, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bsub1): @@ -1317,9 +1225,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, } else { - BEFORE_POTENTIAL_GC (); TOP = Fsub1 (v1); - AFTER_POTENTIAL_GC (); } NEXT; } @@ -1335,9 +1241,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, } else { - BEFORE_POTENTIAL_GC (); TOP = Fadd1 (v1); - AFTER_POTENTIAL_GC (); } NEXT; } @@ -1345,11 +1249,9 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Beqlsign): { Lisp_Object v1, v2; - BEFORE_POTENTIAL_GC (); v2 = POP; v1 = TOP; CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (v1); CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (v2); - AFTER_POTENTIAL_GC (); if (FLOATP (v1) || FLOATP (v2)) { double f1, f2; @@ -1366,48 +1268,38 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bgtr): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = arithcompare (TOP, v1, ARITH_GRTR); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Blss): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = arithcompare (TOP, v1, ARITH_LESS); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bleq): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = arithcompare (TOP, v1, ARITH_LESS_OR_EQUAL); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bgeq): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = arithcompare (TOP, v1, ARITH_GRTR_OR_EQUAL); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bdiff): - BEFORE_POTENTIAL_GC (); DISCARD (1); TOP = Fminus (2, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bnegate): @@ -1421,55 +1313,41 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, } else { - BEFORE_POTENTIAL_GC (); TOP = Fminus (1, &TOP); - AFTER_POTENTIAL_GC (); } NEXT; } CASE (Bplus): - BEFORE_POTENTIAL_GC (); DISCARD (1); TOP = Fplus (2, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bmax): - BEFORE_POTENTIAL_GC (); DISCARD (1); TOP = Fmax (2, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bmin): - BEFORE_POTENTIAL_GC (); DISCARD (1); TOP = Fmin (2, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bmult): - BEFORE_POTENTIAL_GC (); DISCARD (1); TOP = Ftimes (2, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bquo): - BEFORE_POTENTIAL_GC (); DISCARD (1); TOP = Fquo (2, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Brem): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Frem (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } @@ -1482,23 +1360,17 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, } CASE (Bgoto_char): - BEFORE_POTENTIAL_GC (); TOP = Fgoto_char (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Binsert): - BEFORE_POTENTIAL_GC (); TOP = Finsert (1, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (BinsertN): op = FETCH; - BEFORE_POTENTIAL_GC (); DISCARD (op - 1); TOP = Finsert (op, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bpoint_max): @@ -1518,17 +1390,13 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, } CASE (Bchar_after): - BEFORE_POTENTIAL_GC (); TOP = Fchar_after (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bfollowing_char): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = Ffollowing_char (); - AFTER_POTENTIAL_GC (); PUSH (v1); NEXT; } @@ -1536,9 +1404,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bpreceding_char): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = Fprevious_char (); - AFTER_POTENTIAL_GC (); PUSH (v1); NEXT; } @@ -1546,17 +1412,13 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bcurrent_column): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); XSETFASTINT (v1, current_column ()); - AFTER_POTENTIAL_GC (); PUSH (v1); NEXT; } CASE (Bindent_to): - BEFORE_POTENTIAL_GC (); TOP = Findent_to (TOP, Qnil); - AFTER_POTENTIAL_GC (); NEXT; CASE (Beolp): @@ -1580,62 +1442,46 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, NEXT; CASE (Bset_buffer): - BEFORE_POTENTIAL_GC (); TOP = Fset_buffer (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Binteractive_p): /* Obsolete since 24.1. */ - BEFORE_POTENTIAL_GC (); PUSH (call0 (intern ("interactive-p"))); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bforward_char): - BEFORE_POTENTIAL_GC (); TOP = Fforward_char (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bforward_word): - BEFORE_POTENTIAL_GC (); TOP = Fforward_word (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bskip_chars_forward): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fskip_chars_forward (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bskip_chars_backward): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fskip_chars_backward (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bforward_line): - BEFORE_POTENTIAL_GC (); TOP = Fforward_line (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bchar_syntax): { int c; - BEFORE_POTENTIAL_GC (); CHECK_CHARACTER (TOP); - AFTER_POTENTIAL_GC (); c = XFASTINT (TOP); if (NILP (BVAR (current_buffer, enable_multibyte_characters))) MAKE_CHAR_MULTIBYTE (c); @@ -1646,97 +1492,73 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bbuffer_substring): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fbuffer_substring (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bdelete_region): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fdelete_region (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bnarrow_to_region): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fnarrow_to_region (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bwiden): - BEFORE_POTENTIAL_GC (); PUSH (Fwiden ()); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bend_of_line): - BEFORE_POTENTIAL_GC (); TOP = Fend_of_line (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bset_marker): { Lisp_Object v1, v2; - BEFORE_POTENTIAL_GC (); v1 = POP; v2 = POP; TOP = Fset_marker (TOP, v2, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bmatch_beginning): - BEFORE_POTENTIAL_GC (); TOP = Fmatch_beginning (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bmatch_end): - BEFORE_POTENTIAL_GC (); TOP = Fmatch_end (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bupcase): - BEFORE_POTENTIAL_GC (); TOP = Fupcase (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bdowncase): - BEFORE_POTENTIAL_GC (); TOP = Fdowncase (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bstringeqlsign): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fstring_equal (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bstringlss): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fstring_lessp (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } @@ -1751,10 +1573,8 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bnthcdr): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fnthcdr (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } @@ -1765,11 +1585,9 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, { /* Exchange args and then do nth. */ EMACS_INT n; - BEFORE_POTENTIAL_GC (); v2 = POP; v1 = TOP; CHECK_NUMBER (v2); - AFTER_POTENTIAL_GC (); n = XINT (v2); immediate_quit = 1; while (--n >= 0 && CONSP (v1)) @@ -1779,10 +1597,8 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, } else { - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Felt (TOP, v1); - AFTER_POTENTIAL_GC (); } NEXT; } @@ -1790,46 +1606,36 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bmember): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fmember (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bassq): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fassq (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bnreverse): - BEFORE_POTENTIAL_GC (); TOP = Fnreverse (TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bsetcar): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fsetcar (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } CASE (Bsetcdr): { Lisp_Object v1; - BEFORE_POTENTIAL_GC (); v1 = POP; TOP = Fsetcdr (TOP, v1); - AFTER_POTENTIAL_GC (); NEXT; } @@ -1850,10 +1656,8 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, } CASE (Bnconc): - BEFORE_POTENTIAL_GC (); DISCARD (1); TOP = Fnconc (2, &TOP); - AFTER_POTENTIAL_GC (); NEXT; CASE (Bnumberp): @@ -1870,14 +1674,10 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, interpreter. */ case Bset_mark: - BEFORE_POTENTIAL_GC (); error ("set-mark is an obsolete bytecode"); - AFTER_POTENTIAL_GC (); break; case Bscan_buffer: - BEFORE_POTENTIAL_GC (); error ("scan-buffer is an obsolete bytecode"); - AFTER_POTENTIAL_GC (); break; #endif commit 1873ef3b8986193803cee2721ee738f8dee39514 Author: Paul Eggert Date: Fri Jul 15 22:15:42 2016 +0200 Remove now-inaccurate bytecode comments * src/bytecode.c: Remove comments that are no longer accurate. Most of these are actually old ChangeLog entries. diff --git a/src/bytecode.c b/src/bytecode.c index c9e4a25..75d51cc 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -17,22 +17,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -/* -hacked on by jwz@lucid.com 17-jun-91 - o added a compile-time switch to turn on simple sanity checking; - o put back the obsolete byte-codes for error-detection; - o added a new instruction, unbind_all, which I will use for - tail-recursion elimination; - o made temp_output_buffer_show be called with the right number - of args; - o made the new bytecodes be called with args in the right order; - o added metering support. - -by Hallvard: - o added relative jump instructions; - o all conditionals now only do QUIT if they jump. - */ - #include #include "lisp.h" @@ -314,8 +298,7 @@ struct byte_stack #endif /* The string containing the byte-code, and its current address. - Storing this here protects it from GC because mark_byte_stack - marks it. */ + Storing this here protects it from GC. */ Lisp_Object byte_string; const unsigned char *byte_string_start; commit e95b023163e96538b15f030b7176b7ec59cf86f5 Author: Paul Eggert Date: Fri Jul 15 13:07:09 2016 +0200 Port to glibc 2.24 (pre-release) + ppc64 Inspired by a suggestion by Florian Weimer in: https://sourceware.org/ml/libc-alpha/2016-07/msg00425.html * configure.ac (HAVE_PERSONALITY_ADDR_NO_RANDOMIZE): Rename from HAVE_PERSONALITY_LINUX32, and check for ADDR_NO_RANDOMIZE (the crucial thing) instead of for LINUX32. All uses changed. * src/emacs.c (main) [HAVE_PERSONALITY_ADDR_NO_RANDOMIZE]: Use ADDR_NO_RANDOMIZE from personality.h rather than inventing the flag ourselves. Just set that flag, rather than also setting the persona. When doing it, avoid functions like putenv that may allocate memory. diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index c7ec8ce..5e6146b 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES @@ -233,7 +233,7 @@ HAVE_NET_IF_DL_H HAVE_NET_IF_H HAVE_NLIST_H HAVE_OTF_GET_VARIATION_GLYPHS -HAVE_PERSONALITY_LINUX32 +HAVE_PERSONALITY_ADDR_NO_RANDOMIZE HAVE_PNG HAVE_PNG_H HAVE_POSIX_MEMALIGN diff --git a/configure.ac b/configure.ac index dd1af5b..c94ecb6 100644 --- a/configure.ac +++ b/configure.ac @@ -1643,15 +1643,17 @@ AC_CHECK_HEADERS_ONCE( sys/resource.h sys/utsname.h pwd.h utmp.h util.h) -AC_MSG_CHECKING(if personality LINUX32 can be set) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[personality (PER_LINUX32)]])], - emacs_cv_personality_linux32=yes, - emacs_cv_personality_linux32=no) -AC_MSG_RESULT($emacs_cv_personality_linux32) - -if test $emacs_cv_personality_linux32 = yes; then - AC_DEFINE(HAVE_PERSONALITY_LINUX32, 1, - [Define to 1 if personality LINUX32 can be set.]) +AC_CACHE_CHECK([for ADDR_NO_RANDOMIZE], + [emacs_cv_personality_addr_no_randomize], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[personality (personality (0xffffffff) + | ADDR_NO_RANDOMIZE)]])], + [emacs_cv_personality_addr_no_randomize=yes], + [emacs_cv_personality_addr_no_randomize=no])]) +if test $emacs_cv_personality_addr_no_randomize = yes; then + AC_DEFINE([HAVE_PERSONALITY_ADDR_NO_RANDOMIZE], [1], + [Define to 1 if personality flag ADDR_NO_RANDOMIZE exists.]) fi # Note that Solaris has sys/sysinfo.h which defines struct diff --git a/src/emacs.c b/src/emacs.c index bb85733..b221984 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -112,7 +112,7 @@ extern void moncontrol (int mode); #include #endif -#ifdef HAVE_PERSONALITY_LINUX32 +#ifdef HAVE_PERSONALITY_ADDR_NO_RANDOMIZE #include #endif @@ -796,24 +796,22 @@ main (int argc, char **argv) dumping = !initialized && (strcmp (argv[argc - 1], "dump") == 0 || strcmp (argv[argc - 1], "bootstrap") == 0); -#ifdef HAVE_PERSONALITY_LINUX32 - if (dumping && ! getenv ("EMACS_HEAP_EXEC")) +#ifdef HAVE_PERSONALITY_ADDR_NO_RANDOMIZE + if (dumping) { - /* Set this so we only do this once. */ - xputenv ("EMACS_HEAP_EXEC=true"); - - /* A flag to turn off address randomization which is introduced - in linux kernel shipped with fedora core 4 */ -#define ADD_NO_RANDOMIZE 0x0040000 - personality (PER_LINUX32 | ADD_NO_RANDOMIZE); -#undef ADD_NO_RANDOMIZE - - execvp (argv[0], argv); + int pers = personality (0xffffffff); + if (! (pers & ADDR_NO_RANDOMIZE) + && 0 <= personality (pers | ADDR_NO_RANDOMIZE)) + { + /* Address randomization was enabled, but is now disabled. + Re-execute Emacs to get a clean slate. */ + execvp (argv[0], argv); - /* If the exec fails, try to dump anyway. */ - emacs_perror (argv[0]); + /* If the exec fails, warn and then try without a clean slate. */ + perror (argv[0]); + } } -#endif /* HAVE_PERSONALITY_LINUX32 */ +#endif #if defined (HAVE_SETRLIMIT) && defined (RLIMIT_STACK) && !defined (CYGWIN) /* Extend the stack space available. Don't do that if dumping,