Skip to content

Commit

Permalink
Fix LTTng array size types. (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerilk authored Jul 1, 2024
1 parent ef10aa1 commit e83572b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion utils/meta_parameters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def initialize(command, name, size)
size = "*#{size}"
size = "(#{size} < 0 ? 0 : (size_t)#{size})" if INT_SIGN_MAP["#{s.type.type}"]
sz = sanitize_expression("#{size}", checks)
st = INT_SIGN_MAP["#{s.type.type}"] ? "size_t" : "#{s.type}"
st = INT_SIGN_MAP["#{s.type.type}"] ? "size_t" : "#{s.type.type}"
else
checks = check_for_null("#{name}")
size = "(#{size} < 0 ? 0 : (size_t)#{size})" if INT_SIGN_MAP["#{s.type}"]
Expand Down
2 changes: 2 additions & 0 deletions utils/yaml_ast_lttng.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def lttng_type(length: nil, length_type: nil)
ev.type = :uint8_t
if ev.length
ev.length = "(#{ev.length}) * sizeof(uint8_t)"
ev.length_type = "size_t"
end
when *OBJECT_TYPES, *POINTER_TYPES
ev.macro = :"ctf_#{lttng_arr_type}_hex"
Expand All @@ -202,6 +203,7 @@ def lttng_type(length: nil, length_type: nil)
ev.type = :uint8_t
if ev.length
ev.length = "(#{ev.length}) * sizeof(#{type.name})"
ev.length_type = "size_t"
end
else
super
Expand Down

0 comments on commit e83572b

Please sign in to comment.