separate out shared PetScan::update_scop_start_end, fixing range of DeclStmt
commit4ed31c61a1912d84fcc08a0d73717ea12ae95b32
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 5 Mar 2014 10:16:25 +0000 (5 11:16 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 19 Mar 2014 09:54:07 +0000 (19 10:54 +0100)
treec3e0542fb72b33edc09d13992929f7a5573bdfac
parentcfa9a73ff1a4bc20169cc827fc82662eb7842f6e
separate out shared PetScan::update_scop_start_end, fixing range of DeclStmt

Essentially the same code was used in two places, one to initalize
the pet_scop corresponding to a pet_expr and one to extend the range
of the pet_scop.
The only difference between the two was that the first would
also include the semicolon after the Stmt corresponding to the pet_expr.
However, this first instance was also being used during the extraction
of a DeclStmt, the range of which already includes the semicolon,
resulting in an invalid range for those pet_scop objects.
In practice this probably didn't have any adverse effects
since the range of the pet_scop would get extended anyway.
Still, it seems more prudent to set the range correctly.

Merge the two pieces of code and make the inclusion of semicolon explicit.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
scan.cc
scan.h