| 856 | } |
| 857 | |
| 858 | expr Pointer::isWritable() const { |
| 859 | auto bid = getShortBid(); |
| 860 | expr non_local |
| 861 | = num_consts_src == 1 ? bid != has_null_block : |
| 862 | (num_consts_src ? bid.ugt(has_null_block + num_consts_src - 1) : true); |
| 863 | if (m.numNonlocals() > num_nonlocals_src) |
| 864 | non_local &= bid.ult(num_nonlocals_src); |
| 865 | if (has_null_block && null_is_dereferenceable) |
| 866 | non_local |= bid == 0; |
| 867 | |
| 868 | non_local &= expr::mkUF("#is_writable", {bid}, expr(false)); |
| 869 | |
| 870 | // check for non-writable byval blocks (which are non-local) |
| 871 | for (auto [byval, is_const] : m.byval_blks) { |
| 872 | if (is_const) |
| 873 | non_local &= bid != byval; |
| 874 | } |
| 875 | |
| 876 | return isLocal() || non_local; |
| 877 | } |
| 878 | |
| 879 | expr Pointer::isByval() const { |
| 880 | auto this_bid = getShortBid(); |
no test coverage detected