MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / needAvoidNullPtr

Function needAvoidNullPtr

src/ast/ast_lint.cpp:346–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344 }
345
346 bool needAvoidNullPtr ( const TypeDeclPtr & type, bool allowDim ) {
347 if ( !type ) {
348 return false;
349 }
350 if ( !allowDim && type->dim.size() ) {
351 return false;
352 }
353 if ( auto * ann = (TypeAnnotation *) type->isPointerToAnnotation() ) {
354 if ( ann->avoidNullPtr() ) {
355 return true;
356 }
357 }
358 return false;
359 }
360
361 struct PathToLoop {
362 const Variable * var = nullptr;

Callers 2

preVisitGlobalLetMethod · 0.85
preVisitMethod · 0.85

Calls 3

isPointerToAnnotationMethod · 0.80
sizeMethod · 0.45
avoidNullPtrMethod · 0.45

Tested by

no test coverage detected