Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checker: fix isnil() markused, use c.table.used_features.auto_str_ptr = true #23464

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix isnil() markused, use c.table.used_features.auto_str_ptr = true
kbkpbot committed Jan 14, 2025
commit 0d71aa9ec96b40969bd35f28fa1d12c5ba0c7952
2 changes: 1 addition & 1 deletion vlib/builtin/builtin.v
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
module builtin

// isnil returns true if an object is nil (only for C objects).
@[inline; markused]
@[inline]
pub fn isnil(v voidptr) bool {
return v == 0
}
6 changes: 3 additions & 3 deletions vlib/v/checker/str.v
Original file line number Diff line number Diff line change
@@ -56,12 +56,12 @@ fn (mut c Checker) string_inter_lit(mut node ast.StringInterLiteral) ast.Type {
if c.pref.skip_unused && !c.is_builtin_mod {
if !c.table.sym(ftyp).has_method('str') {
c.table.used_features.auto_str = true
if ftyp.is_ptr() {
c.table.used_features.auto_str_ptr = true
}
} else {
c.table.used_features.print_types[ftyp.idx()] = true
}
if ftyp.is_ptr() {
c.table.used_features.auto_str_ptr = true
}
c.table.used_features.interpolation = true
}
c.fail_if_unreadable(expr, ftyp, 'interpolation object')