Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
U
util
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
mmix
util
Commits
e864e871
Commit
e864e871
authored
Sep 15, 2015
by
Martin Ruckert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initilizing err_buf early to avoid NULL pointer in panic
parent
277cd082
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
mmixlib/mmixallib.ch
mmixlib/mmixallib.ch
+20
-3
No files found.
mmixlib/mmixallib.ch
View file @
e864e871
...
@@ -25,6 +25,14 @@ jmp_buf mmixal_exit;
...
@@ -25,6 +25,14 @@ jmp_buf mmixal_exit;
#endif
#endif
@z
@z
We need to initialize buffers, especially err_buf, very early.
@x
@<Initialize everything@>=
@y
@<Allocate buffers@>=
@z
We change error messages that handle errors in the command line
We change error messages that handle errors in the command line
(there is none). Errors are no longer written to stderr.
(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.
...
@@ -271,6 +279,14 @@ We allocat single sym nodes to be able to free them.
if (!p) panic("Capacity exceeded: Out of symbol memory");
if (!p) panic("Capacity exceeded: Out of symbol memory");
@z
@z
Now we start with the rest of the initialization.
@x
@<Init...@>=
@y
@<Initialize everything@>=
@z
The special names are already defined in mmix-sim.w
The special names are already defined in mmix-sim.w
@x
@x
...
@@ -427,7 +443,10 @@ int mmixal(char *mms_name, char *mmo_name, char *mml_name, int x_option, int b_o
...
@@ -427,7 +443,10 @@ int mmixal(char *mms_name, char *mmo_name, char *mml_name, int x_option, int b_o
if (err_count!=0){
if (err_count!=0){
prune(trie_root);
prune(trie_root);
goto clean_up;
goto clean_up;
}
}
buf_size = b_option;
expanding = x_option;
@<Allocate buffers@>
if (mms_name==NULL)
if (mms_name==NULL)
panic("No input file name");
panic("No input file name");
src_file_name= mms_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
...
@@ -439,8 +458,6 @@ int mmixal(char *mms_name, char *mmo_name, char *mml_name, int x_option, int b_o
listing_name[0]=0;
listing_name[0]=0;
else
else
strncpy(listing_name,mml_name,FILENAME_MAX);
strncpy(listing_name,mml_name,FILENAME_MAX);
expanding = x_option;
buf_size = b_option;
cur_file=0;
cur_file=0;
line_no=0;
line_no=0;
long_warning_given=0;
long_warning_given=0;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment