Commit e864e871 authored by Martin Ruckert's avatar Martin Ruckert

initilizing err_buf early to avoid NULL pointer in panic

parent 277cd082
......@@ -25,6 +25,14 @@ jmp_buf mmixal_exit;
We need to initialize buffers, especially err_buf, very early.
@<Initialize everything@>=
@<Allocate buffers@>=
We change error messages that handle errors in the command line
(there is none). Errors are no longer written to stderr.
......@@ -271,6 +279,14 @@ We allocat single sym nodes to be able to free them.
if (!p) panic("Capacity exceeded: Out of symbol memory");
Now we start with the rest of the initialization.
@<Initialize everything@>=
The special names are already defined in mmix-sim.w
......@@ -428,6 +444,9 @@ int mmixal(char *mms_name, char *mmo_name, char *mml_name, int x_option, int b_o
goto clean_up;
buf_size = b_option;
expanding = x_option;
@<Allocate buffers@>
if (mms_name==NULL)
panic("No input file name");
src_file_name= mms_name;
......@@ -439,8 +458,6 @@ int mmixal(char *mms_name, char *mmo_name, char *mml_name, int x_option, int b_o
expanding = x_option;
buf_size = b_option;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment