diff options
author | Björn Gustavsson <[email protected]> | 2018-02-01 15:59:02 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2018-02-01 15:59:02 +0100 |
commit | 18d9afbd5c62bb7b7237fe0d580fc05737a096c1 (patch) | |
tree | d68c29a4d077ce205982a114d65d738e600ec7ea /lib/compiler/src/beam_validator.erl | |
parent | bb0b3c7252119604cf3e8c9ba78d20000e06f4ea (diff) | |
parent | fbcff5a137e37edd80aca9c5fe18ce6880648169 (diff) | |
download | otp-18d9afbd5c62bb7b7237fe0d580fc05737a096c1.tar.gz otp-18d9afbd5c62bb7b7237fe0d580fc05737a096c1.tar.bz2 otp-18d9afbd5c62bb7b7237fe0d580fc05737a096c1.zip |
Merge pull request #1701 from bjorng/bjorn/get_hd_tl
Eliminate get_list/3 internally in the compiler
Diffstat (limited to 'lib/compiler/src/beam_validator.erl')
-rw-r--r-- | lib/compiler/src/beam_validator.erl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl index f8bf935132..7e5d86c177 100644 --- a/lib/compiler/src/beam_validator.erl +++ b/lib/compiler/src/beam_validator.erl @@ -591,6 +591,12 @@ valfun_4({get_list,Src,D1,D2}, Vst0) -> assert_type(cons, Src, Vst0), Vst = set_type_reg(term, D1, Vst0), set_type_reg(term, D2, Vst); +valfun_4({get_hd,Src,Dst}, Vst) -> + assert_type(cons, Src, Vst), + set_type_reg(term, Dst, Vst); +valfun_4({get_tl,Src,Dst}, Vst) -> + assert_type(cons, Src, Vst), + set_type_reg(term, Dst, Vst); valfun_4({get_tuple_element,Src,I,Dst}, Vst) -> assert_type({tuple_element,I+1}, Src, Vst), set_type_reg(term, Dst, Vst); |