[Cmucl-cvs] [git] CMU Common Lisp branch master updated. 20f-48-g1daac74
Raymond Toy
rtoy at common-lisp.net
Sun Oct 19 18:10:04 UTC 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".
The branch, master has been updated
via 1daac74f63836c9eeb98e53e77d69180698eef5e (commit)
via 57bf81f9292bccdda0ca1d9821d71a2f4de52518 (commit)
via 2307b3f7b59e431ae030f676a766601915205e74 (commit)
from b6f5f1f52966abc0677ef7e506c5125cfea066d4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1daac74f63836c9eeb98e53e77d69180698eef5e
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Sun Oct 19 11:08:06 2014 -0700
Clarify a few things.
* Change check for id to be 1 <= id <= 3, and print error message if
it's not true.
* Add comment that we're "intentionally" writing past the end of
segname because we're trying to fill out the rest of the
segment_command.
* Fix typo in sentence.
diff --git a/src/lisp/mach-o.c b/src/lisp/mach-o.c
index b7ab848..f649568 100644
--- a/src/lisp/mach-o.c
+++ b/src/lisp/mach-o.c
@@ -259,7 +259,7 @@ write_space_object(const char *dir, int id, os_vm_address_t start, os_vm_address
((end - start) % os_vm_page_size));
static char *names[] = { "Dynamic", "Static", "Read-Only" };
- if(id < 1 || id > 3) {
+ if (!(1 <= id) && (id <= 3)) {
fprintf(stderr, "Invalid space id in %s: %d\n", __func__, id);
fprintf(stderr, "Executable not built.\n");
ret = -1;
@@ -425,6 +425,14 @@ map_core_sections(const char *exec_name)
fprintf(stderr, "Reading next %ld bytes for SEGMENT\n", sizeof(sc) - sizeof(lc));
#endif
+ /*
+ * This will read in the rest of the slots of a
+ * segment_command, starting from segname. The initial
+ * slots of the segment_command were read above for the
+ * load_command. Alternatively, we could read in each slot
+ * individually, but that's error prone, especially if a
+ * new slot is ever added.
+ */
eread(exec_fd, &sc.segname, sizeof(sc) - sizeof(lc), __func__);
#ifdef DEBUG_MACH_O
@@ -445,7 +453,7 @@ map_core_sections(const char *exec_name)
#endif
/*
* We don't care what address the segment has. We
- * will map it where want it to go.
+ * will map it where it wants to go.
*/
addr = section_addr[j];
commit 57bf81f9292bccdda0ca1d9821d71a2f4de52518
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Sun Oct 19 11:04:23 2014 -0700
Don't leak the string created by strdup.
Probably harmless if we do since we exit(0) at the end.
diff --git a/src/lisp/save.c b/src/lisp/save.c
index 27b03ea..795fac9 100644
--- a/src/lisp/save.c
+++ b/src/lisp/save.c
@@ -249,7 +249,8 @@ boolean
save_executable(char *filename, lispobj init_function)
{
char *dir_name;
-
+ char *dir_copy;
+
#if defined WANT_CGC
volatile lispobj *func_ptr = &init_function;
char sbuf[128];
@@ -271,7 +272,8 @@ save_executable(char *filename, lispobj init_function)
if(SymbolValue(X86_CGC_ACTIVE_P) != NIL)
SetSymbolValue(ALLOCATION_POINTER, DYNAMIC_0_SPACE_START);
#endif
- dir_name = dirname(strdup(filename));
+ dir_copy = strdup(filename);
+ dir_name = dirname(dir_copy);
printf("[Undoing binding stack... ");
fflush(stdout);
@@ -357,6 +359,7 @@ save_executable(char *filename, lispobj init_function)
fflush(stdout);
obj_run_linker(init_function, filename);
printf("done.\n");
+ free(dir_copy);
exit(0);
}
#endif
commit 2307b3f7b59e431ae030f676a766601915205e74
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Sun Oct 19 11:03:04 2014 -0700
Close the file descriptor when done.
diff --git a/src/lisp/coreparse.c b/src/lisp/coreparse.c
index d9b5006..efa53c2 100644
--- a/src/lisp/coreparse.c
+++ b/src/lisp/coreparse.c
@@ -178,5 +178,7 @@ load_core_file(const char *file, fpu_mode_t* fpu_type)
ptr += len - 2;
}
+ close(fd);
+
return initial_function;
}
-----------------------------------------------------------------------
Summary of changes:
src/lisp/coreparse.c | 2 ++
src/lisp/mach-o.c | 12 ++++++++++--
src/lisp/save.c | 7 +++++--
3 files changed, 17 insertions(+), 4 deletions(-)
hooks/post-receive
--
CMU Common Lisp
More information about the cmucl-cvs
mailing list