Skip to content

Commit

Permalink
asn1: Improve partial decode support
Browse files Browse the repository at this point in the history
This commit fixes multiple bugs in the "exclusive decode" and
"selective decode" features for the BER backend of the ASN.1 compiler.

Errors in the configuration file now result error messages,
instead of crashing the ASN.1 or Erlang compiler.

The undocumented option `{asn1config,ModuleName}` has been removed.
  • Loading branch information
bjorng committed Oct 26, 2023
1 parent 95de100 commit 3515f98
Show file tree
Hide file tree
Showing 19 changed files with 855 additions and 648 deletions.
1 change: 1 addition & 0 deletions lib/asn1/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ CT_MODULES= \
asn1ct_tok \
asn1ct_parser2 \
asn1ct_table \
asn1ct_partial_decode \
$(EVAL_CT_MODULES)

RT_MODULES= \
Expand Down
4 changes: 3 additions & 1 deletion lib/asn1/src/asn1_db.erl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ loop(#state{parent = Parent, monitor = MRef, table = Table,
loop(State);
{save, OutFile, Mod} ->
Mtab = ets:lookup_element(Table, Mod, 2),
TempFile = OutFile ++ ".#temp",
TempFile = OutFile ++
integer_to_list(erlang:unique_integer([positive])) ++
".#temp",
ok = ets:tab2file(Mtab, TempFile),
ok = file:rename(TempFile, OutFile),
loop(State);
Expand Down
Loading

0 comments on commit 3515f98

Please sign in to comment.