[patch] fix use of uninitialized variable in <util/delay.h>

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch] fix use of uninitialized variable in <util/delay.h>

Yuriy M. Kaminskiy

... due to missing return after fallback to _delay_ms() when
__builtin_avr_delay_cycles is not used.

Regression by r2385.


diff --git a/include/util/delay.h.in b/include/util/delay.h.in
index 524c56f6..870eb737 100644
--- a/include/util/delay.h.in
+++ b/include/util/delay.h.in
@@ -285,6 +285,7 @@ _delay_us(double __us)
  else if (__tmp2 > 65535)
  {
  _delay_ms(__us / 1000.0);
+ return;
  }
  else if (__tmp > 255)
  {
Reply | Threaded
Open this post in threaded view
|

Re: [patch] fix use of uninitialized variable in <util/delay.h>

Joerg Wunsch
As Yuriy M. Kaminskiy wrote:

> ... due to missing return after fallback to _delay_ms() when
> __builtin_avr_delay_cycles is not used.

Well, normally, I'd like to have things like this going into a bug
tracker.

However, as this bug fix was pretty obvious, I just applied the
patch to the tree. Thanks for spotting it!

--
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)