@@ -33,7 +33,7 @@ Library::Library() : allocid(0)
3333 _dealloc[" fclose" ] = allocid;
3434}
3535
36- Library::Library (const Library &lib) : use(lib.use), ignore(lib.ignore), noreturn(lib.noreturn), allocid(lib.allocid), _alloc(lib._alloc), _dealloc(lib._dealloc)
36+ Library::Library (const Library &lib) : use(lib.use), ignore(lib.ignore), allocid(lib.allocid), _alloc(lib._alloc), _dealloc(lib._dealloc), _noreturn(lib._noreturn )
3737{
3838
3939}
@@ -69,9 +69,28 @@ bool Library::load(const char path[])
6969
7070 else if (strcmp (node->Name ()," ignore" )==0 )
7171 ignore.insert (node->GetText ());
72- else if (strcmp (node->Name ()," noreturn" )==0 )
73- noreturn.insert (node->GetText ());
74- else
72+ else if (strcmp (node->Name ()," function" )==0 ) {
73+ const char *name = node->Attribute (" name" );
74+ if (name == NULL )
75+ return false ;
76+
77+ for (const tinyxml2::XMLElement *functionnode = node->FirstChildElement (); functionnode; functionnode = functionnode->NextSiblingElement ()) {
78+ if (strcmp (functionnode->Name ()," noreturn" )==0 )
79+ _noreturn[name] = (strcmp (functionnode->GetText (), " true" ) == 0 );
80+ else if (strcmp (functionnode->Name ()," arg" )==0 && functionnode->Attribute (" nr" ) != NULL ) {
81+ const int nr = atoi (functionnode->Attribute (" nr" ));
82+
83+ const char *nullpointer = functionnode->Attribute (" nullpointer" );
84+ const char *uninitdata = functionnode->Attribute (" uninitdata" );
85+ const char *uninitderefdata = functionnode->Attribute (" uninitderefdata" );
86+
87+ functionArgument[name][nr].nullpointer = (nullpointer != NULL );
88+ functionArgument[name][nr].uninitdata = (uninitdata != NULL );
89+ functionArgument[name][nr].uninitderefdata = (uninitderefdata != NULL );
90+ } else
91+ return false ;
92+ }
93+ } else
7594 return false ;
7695 }
7796 return true ;
0 commit comments