diff options
| author | Andrea Corallo | 2019-06-30 10:11:39 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-01-01 11:33:47 +0100 |
| commit | b5b0e63bbc23a6584e5aaa49861a37b832a0def3 (patch) | |
| tree | 489070be4a624756f4c2de75085908b231dcde6c /src | |
| parent | 58dfd08fed075df5b0e8b059716b3e3638eafce9 (diff) | |
| download | emacs-b5b0e63bbc23a6584e5aaa49861a37b832a0def3.tar.gz emacs-b5b0e63bbc23a6584e5aaa49861a37b832a0def3.zip | |
fix setcar
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/src/comp.c b/src/comp.c index 4973a517d6f..538169c0b2a 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -657,7 +657,7 @@ emit_VECTORLIKEP (gcc_jit_rvalue *obj) | |||
| 657 | static gcc_jit_rvalue * | 657 | static gcc_jit_rvalue * |
| 658 | emit_CONSP (gcc_jit_rvalue *obj) | 658 | emit_CONSP (gcc_jit_rvalue *obj) |
| 659 | { | 659 | { |
| 660 | emit_comment ("CONSP"); | 660 | emit_comment ("CONSP"); |
| 661 | 661 | ||
| 662 | return emit_TAGGEDP (obj, Lisp_Cons); | 662 | return emit_TAGGEDP (obj, Lisp_Cons); |
| 663 | } | 663 | } |
| @@ -928,11 +928,14 @@ emit_CHECK_CONS (gcc_jit_rvalue *x) | |||
| 928 | emit_lisp_obj_from_ptr (Qconsp), | 928 | emit_lisp_obj_from_ptr (Qconsp), |
| 929 | x }; | 929 | x }; |
| 930 | 930 | ||
| 931 | gcc_jit_context_new_call (comp.ctxt, | 931 | gcc_jit_block_add_eval ( |
| 932 | NULL, | 932 | comp.block->gcc_bb, |
| 933 | comp.check_type, | 933 | NULL, |
| 934 | 3, | 934 | gcc_jit_context_new_call (comp.ctxt, |
| 935 | args); | 935 | NULL, |
| 936 | comp.check_type, | ||
| 937 | 3, | ||
| 938 | args)); | ||
| 936 | } | 939 | } |
| 937 | 940 | ||
| 938 | static gcc_jit_rvalue * | 941 | static gcc_jit_rvalue * |
| @@ -1497,11 +1500,28 @@ define_setcar (void) | |||
| 1497 | comp.block = init_block; | 1500 | comp.block = init_block; |
| 1498 | comp.func = comp.setcar; | 1501 | comp.func = comp.setcar; |
| 1499 | 1502 | ||
| 1503 | /* CHECK_CONS (cell); */ | ||
| 1500 | emit_CHECK_CONS (gcc_jit_param_as_rvalue (cell)); | 1504 | emit_CHECK_CONS (gcc_jit_param_as_rvalue (cell)); |
| 1501 | 1505 | ||
| 1506 | /* CHECK_IMPURE (cell, XCONS (cell)); */ | ||
| 1507 | gcc_jit_rvalue *args[] = | ||
| 1508 | { gcc_jit_param_as_rvalue (cell), | ||
| 1509 | emit_XCONS (gcc_jit_param_as_rvalue (cell)) }; | ||
| 1510 | |||
| 1511 | gcc_jit_block_add_eval ( | ||
| 1512 | init_block->gcc_bb, | ||
| 1513 | NULL, | ||
| 1514 | gcc_jit_context_new_call (comp.ctxt, | ||
| 1515 | NULL, | ||
| 1516 | comp.check_impure, | ||
| 1517 | 2, | ||
| 1518 | args)); | ||
| 1519 | |||
| 1520 | /* XSETCAR (cell, newcar); */ | ||
| 1502 | emit_XSETCAR (gcc_jit_param_as_rvalue (cell), | 1521 | emit_XSETCAR (gcc_jit_param_as_rvalue (cell), |
| 1503 | gcc_jit_param_as_rvalue (new_car)); | 1522 | gcc_jit_param_as_rvalue (new_car)); |
| 1504 | 1523 | ||
| 1524 | /* return newcar; */ | ||
| 1505 | gcc_jit_block_end_with_return (init_block->gcc_bb, | 1525 | gcc_jit_block_end_with_return (init_block->gcc_bb, |
| 1506 | NULL, | 1526 | NULL, |
| 1507 | gcc_jit_param_as_rvalue (new_car)); | 1527 | gcc_jit_param_as_rvalue (new_car)); |
| @@ -1600,9 +1620,7 @@ define_CHECK_IMPURE (void) | |||
| 1600 | comp.block = init_block; | 1620 | comp.block = init_block; |
| 1601 | comp.func = comp.check_impure; | 1621 | comp.func = comp.check_impure; |
| 1602 | 1622 | ||
| 1603 | emit_cond_jump ( | 1623 | emit_cond_jump (emit_PURE_P (gcc_jit_param_as_rvalue (param[0])), /* FIXME */ |
| 1604 | emit_cast (comp.bool_type, | ||
| 1605 | emit_PURE_P (gcc_jit_param_as_rvalue (param[0]))), /* FIXME */ | ||
| 1606 | err_block, | 1624 | err_block, |
| 1607 | ok_block); | 1625 | ok_block); |
| 1608 | gcc_jit_block_end_with_void_return (ok_block->gcc_bb, NULL); | 1626 | gcc_jit_block_end_with_void_return (ok_block->gcc_bb, NULL); |