[PATCH 3/3] covoar: Fix overflow of high PC address
This fixes an integer overflow that would occur if a function's high PC address were zero in the DWARF info. --- tester/covoar/ExecutableInfo.cc | 5 + 1 file changed, 5 insertions(+) diff --git a/tester/covoar/ExecutableInfo.cc b/tester/covoar/ExecutableInfo.cc index 30828a6..7f33f20 100644 --- a/tester/covoar/ExecutableInfo.cc +++ b/tester/covoar/ExecutableInfo.cc @@ -71,6 +71,11 @@ namespace Coverage { } } + // We can't process a zero size function. + if (func.pc_high() == 0) { +continue; + } + createCoverageMap (cu.name(), func.name(), func.pc_low(), func.pc_high() - 1); } -- 2.27.0 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 3/3] covoar: Fix overflow of high PC address
ping On Fri, Mar 12, 2021 at 11:14 AM Alex White wrote: > > This fixes an integer overflow that would occur if a function's high PC > address were zero in the DWARF info. > --- > tester/covoar/ExecutableInfo.cc | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/tester/covoar/ExecutableInfo.cc b/tester/covoar/ExecutableInfo.cc > index 30828a6..7f33f20 100644 > --- a/tester/covoar/ExecutableInfo.cc > +++ b/tester/covoar/ExecutableInfo.cc > @@ -71,6 +71,11 @@ namespace Coverage { > } > } > > + // We can't process a zero size function. > + if (func.pc_high() == 0) { > + continue; > + } > + > createCoverageMap (cu.name(), func.name(), > func.pc_low(), func.pc_high() - 1); > } > -- > 2.27.0 > > ___ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 3/3] covoar: Fix overflow of high PC address
looks ok. what happens if the high_pc is 1? Just wondering. On Tue, Mar 30, 2021 at 8:45 AM Alex White wrote: > > ping > > On Fri, Mar 12, 2021 at 11:14 AM Alex White wrote: > > > > This fixes an integer overflow that would occur if a function's high PC > > address were zero in the DWARF info. > > --- > > tester/covoar/ExecutableInfo.cc | 5 + > > 1 file changed, 5 insertions(+) > > > > diff --git a/tester/covoar/ExecutableInfo.cc > > b/tester/covoar/ExecutableInfo.cc > > index 30828a6..7f33f20 100644 > > --- a/tester/covoar/ExecutableInfo.cc > > +++ b/tester/covoar/ExecutableInfo.cc > > @@ -71,6 +71,11 @@ namespace Coverage { > > } > >} > > > > + // We can't process a zero size function. > > + if (func.pc_high() == 0) { > > +continue; > > + } > > + > >createCoverageMap (cu.name(), func.name(), > >func.pc_low(), func.pc_high() - 1); > > } > > -- > > 2.27.0 > > > > ___ > > devel mailing list > > devel@rtems.org > > http://lists.rtems.org/mailman/listinfo/devel > ___ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
RE: [PATCH 3/3] covoar: Fix overflow of high PC address
On Tue, Mar 30, 2021 at 10:09 AM Gedare Bloom wrote: > > looks ok. what happens if the high_pc is 1? Just wondering. Good question. :) I believe a zero-sized AddressRange is constructed and added to that symbol's CoverageMap. It is possibly wasteful, but should not cause a crash or anything. Alex > > On Tue, Mar 30, 2021 at 8:45 AM Alex White wrote: > > > > ping > > > > On Fri, Mar 12, 2021 at 11:14 AM Alex White wrote: > > > > > > This fixes an integer overflow that would occur if a function's high PC > > > address were zero in the DWARF info. > > > --- > > > tester/covoar/ExecutableInfo.cc | 5 + > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/tester/covoar/ExecutableInfo.cc > > > b/tester/covoar/ExecutableInfo.cc > > > index 30828a6..7f33f20 100644 > > > --- a/tester/covoar/ExecutableInfo.cc > > > +++ b/tester/covoar/ExecutableInfo.cc > > > @@ -71,6 +71,11 @@ namespace Coverage { > > > } > > > } > > > > > > + // We can't process a zero size function. > > > + if (func.pc_high() == 0) { > > > + continue; > > > + } > > > + > > > createCoverageMap (cu.name(), func.name(), > > > func.pc_low(), func.pc_high() - 1); > > > } > > > -- > > > 2.27.0 > > > > > > ___ > > > devel mailing list > > > devel@rtems.org > > > http://lists.rtems.org/mailman/listinfo/devel > > ___ > > devel mailing list > > devel@rtems.org > > http://lists.rtems.org/mailman/listinfo/devel > ___ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel