<html><head></head><body>Hi,<br><br>var_Inherit() callers check for errors. But my point is that caller's caller don't and can't because it is indistinguishable from the default value.<br><br>Also because it basically never happens.<br><br>This patch hides bugs, making them harder to debug, IMO.<br><br><div class="gmail_quote">Le 20 mai 2019 09:08:20 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 2019-05-18 18:59, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Le lauantaina 18. toukokuuta 2019, 19.53.23 EEST Marvin Scholz a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> From: Filip Roséen <filip@atch.se><br><br> As var_Inherit will read from the config if the variable is not found<br> in the inherit-chain, the call to (for example) config_GetInt might<br> crash due to the variable not existing. We might also run into<br> undefined-behavior if the caller specifies a type which is not<br> compatible with the underlying config-type.<br><br> This added check fixes the issue by making sure that the type passed<br> matches that of the configuration, otherwise an error is returned.<br></blockquote>This cannot work, because var_Inherit*() calls cannot return an error, and<br>call sites accordingly don't expect one.<br></blockquote><br>All var_Inherit() callers check for an error and return a default value <br>if there is one.<br><br>Reading the value of a variable knowing the type is wrong doesn't seem <br>right. I think this patch is OK.<hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>