fix overflow in atom_to_term error (UN #206)
This commit is contained in:
		@@ -668,10 +668,14 @@ sub_atom(At, Bef, Size, After, SubAt) :-
 | 
			
		||||
atom_to_term(Atom, Term, Bindings) :-
 | 
			
		||||
	atom_codes(Atom, Chars),
 | 
			
		||||
	charsio:open_mem_read_stream(Chars, Stream),
 | 
			
		||||
	read_term(Stream, T, [variable_names(Bindings)]),
 | 
			
		||||
	catch(read_term(Stream, T, [variable_names(Bindings)]),Error,'$handle_atom_to_term_error'(Stream, Error)),
 | 
			
		||||
	close(Stream),
 | 
			
		||||
	T = Term.
 | 
			
		||||
 | 
			
		||||
'$handle_atom_to_term_error'(Stream, Error) :-
 | 
			
		||||
	close(Stream),
 | 
			
		||||
	throw(Error).
 | 
			
		||||
 | 
			
		||||
term_to_atom(Term,Atom) :-
 | 
			
		||||
	nonvar(Atom), !,
 | 
			
		||||
	atom_codes(Atom,S),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user