Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
bd085c20
Commit
bd085c20
authored
Dec 15, 2010
by
Janne Blomqvist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error message for malloc() failure
From-SVN: r167863
parent
272dc851
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
gcc/fortran/ChangeLog
+7
-0
gcc/fortran/misc.c
+1
-1
gcc/fortran/trans.c
+4
-4
No files found.
gcc/fortran/ChangeLog
View file @
bd085c20
2010-12-15 Janne Blomqvist <jb@gcc.gnu.org>
* trans.c (gfc_allocate_with_status): Better error message for
malloc() failure.
(gfc_call_realloc): Likewise.
* misc.c (gfc_getmem): Likewise.
2010-12-15 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/28105
* trans.c (gfc_call_malloc): Improve comment.
(gfc_allocate_with_status): Remove size < 0 check.
...
...
gcc/fortran/misc.c
View file @
bd085c20
...
...
@@ -36,7 +36,7 @@ gfc_getmem (size_t n)
p
=
xmalloc
(
n
);
if
(
p
==
NULL
)
gfc_fatal_error
(
"
Out of memory
-- malloc() failed"
);
gfc_fatal_error
(
"
Allocation would exceed memory limit
-- malloc() failed"
);
memset
(
p
,
0
,
n
);
return
p
;
}
...
...
gcc/fortran/trans.c
View file @
bd085c20
...
...
@@ -590,7 +590,7 @@ gfc_call_malloc (stmtblock_t * block, tree type, tree size)
if (stat)
*stat = LIBERROR_ALLOCATION;
else
runtime_error ("
Out of memory
");
runtime_error ("
Allocation would exceed memory limit
");
}
return newmem;
} */
...
...
@@ -636,7 +636,7 @@ gfc_allocate_with_status (stmtblock_t * block, tree size, tree status)
1
)))));
msg
=
gfc_build_addr_expr
(
pchar_type_node
,
gfc_build_localized_cstring_const
(
"Out of memory
"
));
(
"Allocation would exceed memory limit
"
));
tmp
=
build_call_expr_loc
(
input_location
,
gfor_fndecl_os_error
,
1
,
msg
);
...
...
@@ -1003,7 +1003,7 @@ internal_realloc (void *mem, size_t size)
{
res = realloc (mem, size);
if (!res && size != 0)
_gfortran_os_error ("
Out of memory
");
_gfortran_os_error ("
Allocation would exceed memory limit
");
if (size == 0)
return NULL;
...
...
@@ -1036,7 +1036,7 @@ gfc_call_realloc (stmtblock_t * block, tree mem, tree size)
null_result
=
fold_build2_loc
(
input_location
,
TRUTH_AND_EXPR
,
boolean_type_node
,
null_result
,
nonzero
);
msg
=
gfc_build_addr_expr
(
pchar_type_node
,
gfc_build_localized_cstring_const
(
"Out of memory
"
));
(
"Allocation would exceed memory limit
"
));
tmp
=
fold_build3_loc
(
input_location
,
COND_EXPR
,
void_type_node
,
null_result
,
build_call_expr_loc
(
input_location
,
...
...
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