summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-05-07 14:24:16 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-05-07 14:24:16 (GMT)
commitc136e2c4c1ad02ea2e363fbe71ce54c6255793e2 (patch)
treeba19cc948ac23a3930d9943e94f8e37ec86991c1 /src
parentb38035259b6e09c77d87950fe409fb72d09887d3 (diff)
Extended the Python bindings for the Dex format.
Diffstat (limited to 'src')
-rw-r--r--src/analysis/routine.c2
-rw-r--r--src/analysis/variable.c8
-rw-r--r--src/analysis/variable.h12
3 files changed, 14 insertions, 8 deletions
diff --git a/src/analysis/routine.c b/src/analysis/routine.c
index 336838b..6e56e2d 100644
--- a/src/analysis/routine.c
+++ b/src/analysis/routine.c
@@ -566,7 +566,7 @@ const char *g_binary_routine_get_declarator(GBinRoutine *routine, bool full)
if (routine->full_name != NULL)
new = _g_data_type_to_string(routine->full_name, false);
else
- new = routine->name;
+ new = strdup(routine->name != NULL ? routine->name : "");
if (routine->namespace != NULL)
{
diff --git a/src/analysis/variable.c b/src/analysis/variable.c
index f30c659..95b7a9c 100644
--- a/src/analysis/variable.c
+++ b/src/analysis/variable.c
@@ -149,7 +149,13 @@ GBinVariable *g_binary_variable_new(GDataType *type)
GDataType *g_binary_variable_get_vtype(const GBinVariable *var)
{
- return var->type;
+ GDataType *result; /* Instance à retourner */
+
+ result = var->type;
+
+ g_object_ref(G_OBJECT(result));
+
+ return result;
}
diff --git a/src/analysis/variable.h b/src/analysis/variable.h
index 9fbdc4e..bc284ae 100644
--- a/src/analysis/variable.h
+++ b/src/analysis/variable.h
@@ -37,12 +37,12 @@
/* ------------------- ASSOCIATION D'UN TYPE ET D'UNE DESIGNATION ------------------- */
-#define G_TYPE_BIN_VARIABLE g_binary_variable_get_type()
-#define G_BINARY_VARIABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_binary_variable_get_type(), GBinVariable))
-#define G_IS_BIN_VARIABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_binary_variable_get_type()))
-#define G_BINARY_VARIABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_BIN_VARIABLE, GBinVariableClass))
-#define G_IS_BIN_VARIABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_BIN_VARIABLE))
-#define G_BINARY_VARIABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_BIN_VARIABLE, GBinVariableClass))
+#define G_TYPE_BIN_VARIABLE g_binary_variable_get_type()
+#define G_BIN_VARIABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_BIN_VARIABLE, GBinVariable))
+#define G_IS_BIN_VARIABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_BIN_VARIABLE))
+#define G_BIN_VARIABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_BIN_VARIABLE, GBinVariableClass))
+#define G_IS_BIN_VARIABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_BIN_VARIABLE))
+#define G_BIN_VARIABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_BIN_VARIABLE, GBinVariableClass))
/* Base de variable (instance) */