Skip to content

Commit

Permalink
Fix emit_go error (lcm-proj#294)
Browse files Browse the repository at this point in the history
Add check if member is primitive type before calling lcm_find_struct()
  • Loading branch information
hoxell committed Jan 10, 2020
1 parent ac1882a commit 350b55b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ endif()
lcm_option(
LCM_ENABLE_GO
"Build Go utilities, bindings is source distributed"

# Disable until #294 is resolved
FALSE Go)
# GO_FOUND Go)
GO_FOUND Go)

option(LCM_ENABLE_TESTS "Build unit tests" ON)
if(LCM_ENABLE_TESTS)
Expand Down
7 changes: 5 additions & 2 deletions lcmgen/emit_go.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,11 @@ static unsigned int emit_go_array_loops(FILE *f, lcmgen_t *lcm, lcm_struct_t *ls
map_builtintype_name(lcm_find_member(ls, dim->size)->type->lctypename);

if (slice_emit){
lcm_struct_t *ls_lm = lcm_find_struct(lcm, lm);
uint64_t lm_fingerprint = lcm_get_fingerprint(lcm, ls_lm);
uint64_t lm_fingerprint = fingerprint;
if (!lcm_is_primitive_type(lm->type->lctypename)) {
lcm_struct_t *ls_lm = lcm_find_struct(lcm, lm);
lm_fingerprint = lcm_get_fingerprint(lcm, ls_lm);
}
emit_go_slice_make(f, n + 1, ls->structname->package, lm, n, slicestr->str, size,
lm_fingerprint);
}
Expand Down

0 comments on commit 350b55b

Please sign in to comment.