@@ -136,25 +136,24 @@ void ReportUseAfterFree(const DeviceSanitizerReport &Report,
136136 if (!AllocInfoItOp) {
137137 context.logger .always (" Failed to find which chunck {} is allocated" ,
138138 (void *)Report.Address );
139- return ;
139+ } else {
140+ auto &AllocInfo = (*AllocInfoItOp)->second ;
141+ if (AllocInfo->Context != Context) {
142+ context.logger .always (" Failed to find which chunck {} is allocated" ,
143+ (void *)Report.Address );
144+ }
145+ assert (AllocInfo->IsReleased );
146+
147+ context.logger .always (" {} is located inside of {} region [{}, {})" ,
148+ (void *)Report.Address , ToString (AllocInfo->Type ),
149+ (void *)AllocInfo->UserBegin ,
150+ (void *)AllocInfo->UserEnd );
151+ context.logger .always (" allocated here:" );
152+ AllocInfo->AllocStack .print ();
153+ context.logger .always (" released here:" );
154+ AllocInfo->ReleaseStack .print ();
140155 }
141156
142- auto &AllocInfo = (*AllocInfoItOp)->second ;
143- if (AllocInfo->Context != Context) {
144- context.logger .always (" Failed to find which chunck {} is allocated" ,
145- (void *)Report.Address );
146- }
147- assert (AllocInfo->IsReleased );
148-
149- context.logger .always (" {} is located inside of {} region [{}, {})" ,
150- (void *)Report.Address , ToString (AllocInfo->Type ),
151- (void *)AllocInfo->UserBegin ,
152- (void *)AllocInfo->UserEnd );
153- context.logger .always (" allocated here:" );
154- AllocInfo->AllocStack .print ();
155- context.logger .always (" released here:" );
156- AllocInfo->ReleaseStack .print ();
157-
158157 exit (1 );
159158}
160159
0 commit comments