181 |
|
|
182 |
static Lisp_Object Vloads_in_progress; |
static Lisp_Object Vloads_in_progress; |
183 |
|
|
|
/* Limit of the depth of recursive loads. */ |
|
|
|
|
|
Lisp_Object Vrecursive_load_depth_limit; |
|
|
|
|
184 |
/* Non-zero means load dangerous compiled Lisp files. */ |
/* Non-zero means load dangerous compiled Lisp files. */ |
185 |
|
|
186 |
int load_dangerous_libraries; |
int load_dangerous_libraries; |
730 |
|
|
731 |
Also, just loading a file recursively is not always an error in |
Also, just loading a file recursively is not always an error in |
732 |
the general case; the second load may do something different. */ |
the general case; the second load may do something different. */ |
733 |
if (INTEGERP (Vrecursive_load_depth_limit) |
{ |
734 |
&& XINT (Vrecursive_load_depth_limit) > 0) |
int count = 0; |
735 |
{ |
Lisp_Object tem; |
736 |
Lisp_Object len = Flength (Vloads_in_progress); |
for (tem = Vloads_in_progress; CONSP (tem); tem = XCDR (tem)) |
737 |
if (XFASTINT (len) > XFASTINT (Vrecursive_load_depth_limit)) |
if (!NILP (Fequal (found, XCAR (tem)))) |
738 |
Fsignal (Qerror, Fcons (build_string ("Recursive load suspected"), |
count++; |
739 |
Fcons (found, Vloads_in_progress))); |
if (count > 3) |
740 |
record_unwind_protect (record_load_unwind, Vloads_in_progress); |
Fsignal (Qerror, Fcons (build_string ("Recursive load"), |
741 |
Vloads_in_progress = Fcons (found, Vloads_in_progress); |
Fcons (found, Vloads_in_progress))); |
742 |
} |
record_unwind_protect (record_load_unwind, Vloads_in_progress); |
743 |
|
Vloads_in_progress = Fcons (found, Vloads_in_progress); |
744 |
|
} |
745 |
|
|
746 |
if (!bcmp (&(XSTRING (found)->data[STRING_BYTES (XSTRING (found)) - 4]), |
if (!bcmp (&(XSTRING (found)->data[STRING_BYTES (XSTRING (found)) - 4]), |
747 |
".elc", 4)) |
".elc", 4)) |
3656 |
Vbytecomp_version_regexp |
Vbytecomp_version_regexp |
3657 |
= build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); |
= build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); |
3658 |
|
|
|
DEFVAR_LISP ("recursive-load-depth-limit", &Vrecursive_load_depth_limit, |
|
|
doc: /* Limit for depth of recursive loads. |
|
|
Value should be either an integer > 0 specifying the limit, or nil for |
|
|
no limit. */); |
|
|
Vrecursive_load_depth_limit = make_number (50); |
|
|
|
|
3659 |
/* Vsource_directory was initialized in init_lread. */ |
/* Vsource_directory was initialized in init_lread. */ |
3660 |
|
|
3661 |
load_descriptor_list = Qnil; |
load_descriptor_list = Qnil; |