summaryrefslogtreecommitdiffstats
path: root/tester/covoar/Target_aarch64.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tester/covoar/Target_aarch64.cc')
-rw-r--r--tester/covoar/Target_aarch64.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/tester/covoar/Target_aarch64.cc b/tester/covoar/Target_aarch64.cc
index 4d16456..139f5fe 100644
--- a/tester/covoar/Target_aarch64.cc
+++ b/tester/covoar/Target_aarch64.cc
@@ -49,31 +49,33 @@ namespace Target {
}
bool Target_aarch64::isNopLine(
- const char* const line,
- int& size
+ const std::string& line,
+ int& size
)
{
- if (!strcmp( &line[strlen(line)-3], "nop")) {
+ size_t stringLen = line.length();
+
+ if ( line.substr( stringLen - 3 ) == "nop" ) {
size = 4;
return true;
}
- if (!strncmp( &line[strlen(line)-6], "udf", 3)) {
+ if ( line.substr( stringLen - 6, 3 ) == "udf" ) {
size = 4;
return true;
}
// On ARM, there are literal tables at the end of methods.
// We need to avoid them.
- if (!strncmp( &line[strlen(line)-10], ".byte", 5)) {
+ if ( line.substr( stringLen - 10, 5 ) == ".byte" ) {
size = 1;
return true;
}
- if (!strncmp( &line[strlen(line)-13], ".short", 6)) {
+ if ( line.substr( stringLen - 13, 6 ) == ".short" ) {
size = 2;
return true;
}
- if (!strncmp( &line[strlen(line)-16], ".word", 5)) {
+ if ( line.substr( stringLen - 16, 5 ) == ".word" ) {
size = 4;
return true;
}
@@ -82,7 +84,7 @@ namespace Target {
}
bool Target_aarch64::isBranch(
- const char* instruction
+ const std::string& instruction
)
{
throw rld::error(