do not allow strings containing null characters to be inlined (#2848)
This commit is contained in:
@@ -467,7 +467,7 @@ impl AtomTable {
|
||||
}
|
||||
|
||||
pub fn build_with(atom_table: &AtomTable, string: &str) -> Atom {
|
||||
if 0 < string.len() && string.len() <= INLINED_ATOM_MAX_LEN {
|
||||
if 0 < string.len() && string.len() <= INLINED_ATOM_MAX_LEN && !string.contains('\u{0}') {
|
||||
return Atom::new_inlined(string);
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,6 @@ print_comma_separated_list([VN=_, VNEq | VNEqs]) :-
|
||||
|
||||
filter_anonymous_vars([], []).
|
||||
filter_anonymous_vars([VN=V | VNEqs0], VNEqs) :-
|
||||
'$debug_hook',
|
||||
( atom_concat('_', _, VN) ->
|
||||
filter_anonymous_vars(VNEqs0, VNEqs)
|
||||
; VNEqs = [VN=V | VNEqs1],
|
||||
|
||||
@@ -101,7 +101,8 @@ impl ConsPtr {
|
||||
|
||||
#[inline(always)]
|
||||
pub fn as_ptr(self) -> *mut u8 {
|
||||
unsafe { mem::transmute::<_, *mut u8>(self.ptr()) }
|
||||
let addr: u64 = self.ptr();
|
||||
addr as usize as *mut _
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
||||
Reference in New Issue
Block a user