class AdLint::Exam::CBuiltin::W0461
Public Class Methods
new(phase_ctxt)
click to toggle source
Calls superclass method
AdLint::Examination::new
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 9625 def initialize(phase_ctxt) super @interp = phase_ctxt[:cc1_interpreter] @interp.on_function_call_expr_evaled += T(:check) end
Private Instance Methods
check(funcall_expr, fun, arg_vars, *)
click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 9632 def check(funcall_expr, fun, arg_vars, *) args = arg_vars.zip(fun.type.parameter_types) args.each_with_index do |(arg, type), idx| next unless arg.variable? && arg.value.scalar? next unless type && type.pointer? base_type = type.unqualify.base_type next unless !base_type.function? && base_type.const? if pointee = pointee_of(arg) and pointee.variable? if !pointee.temporary? test = pointee.value.test_must_be_undefined if test.true? arg_expr = funcall_expr.argument_expressions[idx] W(arg_expr.location, *test.evidence.emit_context_messages(self, arg_expr.location)) end end end end end
interpreter()
click to toggle source
# File lib/adlint/exam/c_builtin/cc1_check.rb, line 9654 def interpreter @interp end