File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
tools/ruby-gems/udb/lib/udb/obj Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ data_independent_timing: false
3030hints :
3131 - { $ref: inst/Zicfilp/sspopchk.x1.yaml# }
3232 - { $ref: inst/Zicfilp/sspopchk.x5.yaml# }
33- - { $ref: inst/Zicfilp /ssrdp.yaml# }
33+ - { $ref: inst/Zicfiss /ssrdp.yaml# }
3434pseudoinstructions :
3535 - when : n == 0
3636 to : mop.r.0
Original file line number Diff line number Diff line change @@ -327,6 +327,23 @@ def validate(resolver)
327327 Instruction . deprecated_validate_encoding ( @data [ "encoding" ] [ "RV64" ] , name )
328328 end
329329 end
330+
331+ # Validate hint references
332+ if @data . key? ( "hints" )
333+ @data [ "hints" ] . each_with_index do |hint , index |
334+ if hint . key? ( "$ref" )
335+ begin
336+ # Try to dereference the hint to validate it exists
337+ hint_inst = @cfg_arch . ref ( hint [ "$ref" ] )
338+ if hint_inst . nil?
339+ raise "Invalid hint reference in instruction '#{ name } ' at hints[#{ index } ]: '#{ hint [ "$ref" ] } ' - reference not found"
340+ end
341+ rescue => e
342+ raise "Invalid hint reference in instruction '#{ name } ' at hints[#{ index } ]: '#{ hint [ "$ref" ] } ' - #{ e . message } "
343+ end
344+ end
345+ end
346+ end
330347 end
331348
332349 def ==( other )
You can’t perform that action at this time.
0 commit comments