mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 14:21:10 +02:00
Improve compute_mcode allocation logic
* libguile/jit.c (compute_mcode): Move up some assertions before using them to allocate.
This commit is contained in:
parent
162e313311
commit
24b4d09394
1 changed files with 5 additions and 4 deletions
|
@ -4466,15 +4466,16 @@ compute_mcode (scm_thread *thread, uint32_t *entry_ip,
|
||||||
j->start = (const uint32_t *) (((char *)data) + data->start);
|
j->start = (const uint32_t *) (((char *)data) + data->start);
|
||||||
j->end = (const uint32_t *) (((char *)data) + data->end);
|
j->end = (const uint32_t *) (((char *)data) + data->end);
|
||||||
j->entry = entry_ip;
|
j->entry = entry_ip;
|
||||||
j->op_attrs = malloc ((j->end - j->start) * sizeof (*j->op_attrs));
|
|
||||||
ASSERT (j->op_attrs);
|
|
||||||
j->labels = malloc ((j->end - j->start) * sizeof (*j->labels));
|
|
||||||
ASSERT (j->labels);
|
|
||||||
|
|
||||||
ASSERT (j->start < j->end);
|
ASSERT (j->start < j->end);
|
||||||
ASSERT (j->start <= j->entry);
|
ASSERT (j->start <= j->entry);
|
||||||
ASSERT (j->entry < j->end);
|
ASSERT (j->entry < j->end);
|
||||||
|
|
||||||
|
j->op_attrs = malloc ((j->end - j->start) * sizeof (*j->op_attrs));
|
||||||
|
ASSERT (j->op_attrs);
|
||||||
|
j->labels = malloc ((j->end - j->start) * sizeof (*j->labels));
|
||||||
|
ASSERT (j->labels);
|
||||||
|
|
||||||
j->frame_size = -1;
|
j->frame_size = -1;
|
||||||
j->hooks_enabled = 0; /* ? */
|
j->hooks_enabled = 0; /* ? */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue