diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/analysis/routine.c | 2 | ||||
-rw-r--r-- | src/analysis/variable.c | 8 | ||||
-rw-r--r-- | src/analysis/variable.h | 12 |
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) */ |