Skip to content

Commit 8fdb06f

Browse files
author
Daniel Kroening
committed
preserve location of pointer types
1 parent 0e70863 commit 8fdb06f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ansi-c/c_typecheck_type.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -1492,19 +1492,22 @@ void c_typecheck_baset::adjust_function_parameter(typet &type) const
14921492
{
14931493
if(type.id()==ID_array)
14941494
{
1495+
source_locationt source_location=type.source_location();
14951496
type=pointer_type(type.subtype());
1496-
type.remove(ID_size);
1497-
type.remove(ID_C_constant);
1497+
type.add_source_location()=source_location;
14981498
}
14991499
else if(type.id()==ID_code)
15001500
{
15011501
// see ISO/IEC 9899:1999 page 199 clause 8,
15021502
// may be hidden in typedef
1503+
source_locationt source_location=type.source_location();
15031504
type=pointer_type(type);
1505+
type.add_source_location()=source_location;
15041506
}
15051507
else if(type.id()==ID_KnR)
15061508
{
15071509
// any KnR args without type yet?
15081510
type=signed_int_type(); // the default is integer!
1511+
// no source location
15091512
}
15101513
}

0 commit comments

Comments
 (0)