aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/v3_core.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-03-20 07:34:00 +0100
committerBjörn Gustavsson <[email protected]>2018-03-24 07:32:26 +0100
commita5e80861faedc84d373ccda95ae6f8c7aff11bcf (patch)
treedd5eabc7bcc1cb7e3402b7cc00749a9f04be45d8 /lib/compiler/src/v3_core.erl
parent9d2f5cde19cffca9a00b8fad8075bf160cc872d3 (diff)
downloadotp-a5e80861faedc84d373ccda95ae6f8c7aff11bcf.tar.gz
otp-a5e80861faedc84d373ccda95ae6f8c7aff11bcf.tar.bz2
otp-a5e80861faedc84d373ccda95ae6f8c7aff11bcf.zip
Avoid overflowing the atom table
Use integer variable names instead of atoms in v3_core, sys_core_fold, and v3_kernel to avoid overflowing the atom table. It is a deliberate design decision to calculate the first free integer variable name (in sys_core_fold and v3_kernel) instead of somehow passing it from one pass to another. I don't want that kind of dependency between compiler passes. Also note that the next free variable name is not easily available after running the inliner.
Diffstat (limited to 'lib/compiler/src/v3_core.erl')
-rw-r--r--lib/compiler/src/v3_core.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl
index 6029b91cdc..df0cc3684f 100644
--- a/lib/compiler/src/v3_core.erl
+++ b/lib/compiler/src/v3_core.erl
@@ -2005,7 +2005,7 @@ new_fun_name(Type, #core{fcount=C}=St) ->
%% new_var_name(State) -> {VarName,State}.
new_var_name(#core{vcount=C}=St) ->
- {list_to_atom("@c" ++ integer_to_list(C)),St#core{vcount=C + 1}}.
+ {C,St#core{vcount=C + 1}}.
%% new_var(State) -> {{var,Name},State}.
%% new_var(LineAnno, State) -> {{var,Name},State}.