diff --git a/vlib/builtin/string.v b/vlib/builtin/string.v index 42152dba0213d2..6a30b71305e8bd 100644 --- a/vlib/builtin/string.v +++ b/vlib/builtin/string.v @@ -134,7 +134,7 @@ pub fn tos2(s &u8) string { // It will panic, when the pointer `s` is 0. // It is the same as `tos2`, but for &char pointers, avoiding callsite casts. // See also `tos_clone`. -@[unsafe] +@[markused; unsafe] pub fn tos3(s &char) string { if s == 0 { panic('tos3: nil string') @@ -151,7 +151,7 @@ pub fn tos3(s &char) string { // It returns '', when given a 0 pointer `s`, it does NOT panic. // It is the same as `tos5`, but for &u8 pointers, avoiding callsite casts. // See also `tos_clone`. -@[unsafe] +@[markused; unsafe] pub fn tos4(s &u8) string { if s == 0 { return '' @@ -168,7 +168,7 @@ pub fn tos4(s &u8) string { // It returns '', when given a 0 pointer `s`, it does NOT panic. // It is the same as `tos4`, but for &char pointers, avoiding callsite casts. // See also `tos_clone`. -@[unsafe] +@[markused; unsafe] pub fn tos5(s &char) string { if s == 0 { return '' diff --git a/vlib/v/markused/markused.v b/vlib/v/markused/markused.v index eeda79b1520d1b..26e85f115355d2 100644 --- a/vlib/v/markused/markused.v +++ b/vlib/v/markused/markused.v @@ -363,6 +363,7 @@ pub fn mark_used(mut table ast.Table, mut pref_ pref.Preferences, ast_files []&a walker.mark_markused_globals() // tagged with `@[markused]` walker.mark_exported_fns() walker.mark_root_fns(all_fn_root_names) + walker.mark_veb_actions() if walker.n_asserts > 0 { unsafe { walker.fn_decl(mut all_fns['__print_assert_failure']) } diff --git a/vlib/v/markused/walker.v b/vlib/v/markused/walker.v index 5bf5f65d1a1a41..208b9d4440fe58 100644 --- a/vlib/v/markused/walker.v +++ b/vlib/v/markused/walker.v @@ -93,6 +93,19 @@ pub fn (mut w Walker) mark_root_fns(all_fn_root_names []string) { } } +pub fn (mut w Walker) mark_veb_actions() { + for _, mut func in w.all_fns { + if func.return_type == w.table.veb_res_idx_cache { + // if fn_name !in w.used_fns { + $if trace_skip_veb_actions ? { + println('>>>> walking veb action func: ${func.name} ...') + } + w.fn_decl(mut func) + } + //} + } +} + pub fn (mut w Walker) mark_exported_fns() { for _, mut func in w.all_fns { if func.is_exported {