|
27 | 27 | init_per_group/2,end_per_group/2, |
28 | 28 | create/1,explicit_module_name/1, |
29 | 29 | term_order/1,gc/1,external_term_format/1, |
30 | | - messages/1,errors/1,records_module/1, dist/1]). |
| 30 | + messages/1,errors/1,records_module/1, dist/1, |
| 31 | + gh_11398/1]). |
31 | 32 |
|
32 | 33 | -record #a{x=1, y=2}. |
33 | 34 | -record #b{x=none, y=none, z=none}. |
@@ -62,7 +63,8 @@ all() -> |
62 | 63 | messages, |
63 | 64 | errors, |
64 | 65 | records_module, |
65 | | - dist]. |
| 66 | + dist, |
| 67 | + gh_11398]. |
66 | 68 |
|
67 | 69 | groups() -> |
68 | 70 | []. |
@@ -568,6 +570,24 @@ dist(_Config) -> |
568 | 570 |
|
569 | 571 | ok. |
570 | 572 |
|
| 573 | +gh_11398(_Config) -> |
| 574 | + #native_record_SUITE:exp{a=1} = binary_to_term(y(1, 1)), |
| 575 | + ?assertError(badarg, binary_to_term(y(1, 2))). |
| 576 | + |
| 577 | +y(A, N) when is_integer(A) -> |
| 578 | + <<131, AValue/bytes>> = erlang:term_to_binary(A), |
| 579 | + << |
| 580 | + 131, |
| 581 | + %% RECORD_EXT, N fields, exported flag set |
| 582 | + $C, |
| 583 | + N:32, |
| 584 | + 1:8, |
| 585 | + $w, 19, "native_record_SUITE", |
| 586 | + $w, 3, "exp", |
| 587 | + %% N copies of field name 'a', followed by N copies of value A |
| 588 | + (binary:copy(<<$w, 1, "a">>, N))/bytes, |
| 589 | + (binary:copy(AValue, N))/bytes |
| 590 | + >>. |
571 | 591 |
|
572 | 592 | %%% Common utilities. |
573 | 593 |
|
|
0 commit comments